ERwin Online Help


Basic Features

 ERwin Workplace

 ERwin Basic Features

 Enhancing the Appearance of an ERwin Diagram

 Choosing Modeling Preferences and Diagram Display Options

 Editing and Arranging Diagram Objects

 Subject Areas

 Stored Displays

 Storing Models in the ERwin Dictionary


Physical Modeling

 Working with the Physical Model

 Tables

 Columns

 Relationships

 Physical Domains

 Indexes

 Views

 Relationships

 Constraints

 Triggers

 Scripts

 Stored Procedures

 Physical Storage Objects

 Forward and Reverse Engineering

 Complete Compare


Logical Modeling

 Entities

 Attributes

 Key Groups

 Logical Domains

 Relationships

 Structured Modeling Language (SML)


Reporting

 The Report Browser Workplace

 Using the Report Browser with ERwin

 Using the Report Browser with ModelMart

 Customizing a Result Set View

 Printing a Result Set

 Exporting a Result Set


ERwin and ModelMart

 Using ERwin as a ModelMart Client

 Using ERwin in a Multiuser Environment

 Managing ModelMart Changes

 Managing ModelMart Libraries and Diagrams

 Working with Submodels

 Managing ModelMart Archives and Versions

ModelMart Administration

 ModelMart Administration Overview

 Initializing the ModelMart

 Managing Security in the ModelMart

 Maintaining the ModelMart

 Generating Reports


Client Tools

 PowerBuilder

 Visual Basic


Bidirectional Links

 Using ERwin with BPwin

 Using ERwin with Oracle Designer/2000


Technical Support

 Technical Support Policy

 Customer Service

 Comment on Logic Works Documentation


WEB Link

 Connect to the Logic Works WEB Site

 Select a Browser


What's New in ERwin 3.5?
What’s New in ERwin 3.5?

 Workplace and User Interface Enhancements

 Dimensional Modeling

 User-Defined Properties

 Volumetrics

 Domain Dictionary Editor

 Diagram Editor

 Schema Generation Editor

 ModelMart Version 3.0 Integration

 Report Browser Enhancements

 ERwin 3.5 Release Notes Addendum


Workplace and User Interface Enhancements

 Independent Attribute Browser

 Independent Column Browser

 Menu and Editor Enhancements

 On-Grid Editing

 Extended Notation for Alternate Keys

 Displaying Diagonal Relationship Lines

 Definition and Comment Text Wrap Preferences

 Setting the Target Client Server

 Exporting Expanded Property Values

 Using Icons

 Model Validation Report


Report Browser Enhancements

 Editable ERwin Reports

 Printing a Result Set

 Previewing a Result Set

 Exporting a Result Set


ModelMart Version 3.0 Integration

 Using the ModelMart Change Control Manager

 Generating ModelMart Administrative Reports

 Working with Multiple Submodels

 Snapshot Selection for .ER1 Merge

 Enabling Universal Directory to Read ModelMart Object Properties

 ModelMart Connection Manager Enhancement

 Synchronizing ERwin and BPwin Models in ModelMart


This is a Physical model task. To switch to the physical model, select Physical Model from the list on the ERwin toolbar.


This is a Logical model task. To switch to the logical model, select Logical Model from the list on the ERwin toolbar.


To open the Report Browser, click this button in the ERwin toolbar.


Glossary of Terms

alternate key

application database

architect

attribute

archive version

attribute

attribute group

basename

blobspace

binary relationship

business rule

cardinality

change control

complete subtype cluster

conflict resolution

cascade delete

column display property

column storage property

column property

database

datatype

dbspace

DataWindow

DataWindow Wizard

default/initial value

dependent entity

dimension table

discriminator

display format

domain

DM (Dimensional Modeling)

entity

edit style

ERwin Custom Control

ERwin dictionary

ERwin Form Wizard

ERX format

extended attributes

fact table

foreign key

foreign key migration

forward engineering

guest

IDEF1X

identifying relationship

incomplete subtype cluster

independent entity

Information Engineering

Inheritable Domain Properties

inheritance

input mask

instance

inversion entry

library

library-level object

lock mode

locking option

logical level

many-to-many

master model

metamodel

model management system

modeler

ModelMart Administrator

ModelMart Control Tables

ModelMart Diagram

ModelMart License

ModelMart Model Merge

ModelMart Workgroup

MPD ModelPro format

n-ary relationship

Non-inheritable Domain Properties

non-key attribute

nonidentifying relationship

nonspecific relationship

normalization

null

one-to-many

operation

outrigger table

owned attribute

parent diagram

permission

permission object class

physical level

physical storage object

pre/post script

primary key

recursive relationship

referential integrity

referential integrity trigger

refresh

relationship

restrict

reverse engineering

revert

rolename

Rollback Segment

schema

security profile

Segment

session

set null

SML format

snapshot

source diagram

specific relationship

stored display

stored procedure

STOGROUP

subject area

subtype entity

subtype relationship

synchronizing

Tablespace

target diagram

target server

template

trigger

unification

valid value

validation rule

version comparison

viewer


alternate key

1) An attribute or attributes that uniquely identify an instance of an entity.

2) If more than one attribute or group of attributes satisfies rule 1, the alternate keys are those attributes or groups of attributes not selected as the primary key.

ERwin will generate a unique index for each alternate key.


application database

A database that stores business information.


architect

A ModelMart security profile that is typically assigned to a more experienced modeler who is responsible for managing one or more ModelMart libraries, including the diagrams and shared objects in these libraries.


archive version

A special read-only version of a ModelMart diagram that reflects the state of the parent diagram at some point in its history. You can use an archive version to rollback all or part of the parent diagram in the ModelMart to the state captured in the archive version. Workgroup members can create archive versions and annotate the purpose or content of each archive version. ERwin names an archive version by appending a semicolon and a unique version number to the name of the original ModelMart diagram (e.g., movies;1)


attribute

An attribute represents a type of characteristic or property associated with a set of real or abstract things (people, places, events, etc.). The logical equivalent to a column.


attribute group

A set of attributes that are used to index the table. An attribute group can be an a primary key, an alternate key (AK) or an inversion entry (IE).


basename

The original name of a rolenamed foreign key.


binary relationship

A relationship in which exactly one instance of the parent is related to zero, one, or more instances of a child. In IDEF1X, identifying, non-identifying, and subtype relationships are all binary relationships.


business rule

Logic applied to the use of data within the business, such as "Quantity_Ordered must be less than Quantity_On_Hand." Business rules are implemented using defaults, validation rules, referential integrity, relationship cardinality, triggers, and stored procedures.


cardinality

The ratio of parent instances to child instances. In IDEF1X, the cardinality of binary relationships is 1:n, whereby n may be one of the following:

•	zero, one, or more - signified by a blank space

•	one or more - signified by the letter p

•	zero or one - signified by the letter z

•	exactly n - where n is some number


cascade delete

A referential integrity option. Using the cascade delete option, when you delete a parent instance, all dependent child instances are also deleted (e.g., deleting Order #123 causes the software to also delete all Line Items for Order #123.)


change control

The process of reviewing your changes and/or comparing them with changes saved by other users to the ModelMart master model, resolving conflicts between your changes and the ModelMart master model, and selectively merging your changes back to ModelMart.


column display property

Column definition information that is used to format column data or the column header text when it is displayed in a client application (e.g., display formats, number of decimal places displayed, and column header text).


column storage property

Column definition information that is used to validate information stored on the server (e.g., valid values, range).


column property

A specification of data attributes for the client or the server. Server-side column properties include datatype, null string, validation rules, and default/initial values. You can also define client-side column properties, including edit style, display format, client-side validation rule, and client-side default/initial value.


complete subtype cluster

If the subtype cluster includes all of the possible subtypes (every instance of the generic parent is associated with one subtype), then the subtype cluster is complete. For example, every employee is either male or female, and therefore the subtype cluster of male-employee and female-employee is a complete subtype cluster.


conflict resolution

The process of using the ModelMart Change Control Manager - Conflict Resolution dialog, to compare conflicting changes between your copy of a ModelMart diagram and the master model of the same diagram. To resolve a conflict, you can choose to cancel or save your changes to the ModelMart master model.


database

A database is a reserved amount of space on one or more storage devices that is used to store data and the definitions of database objects such as tables and indexes.


data model

An entity relation model using IDEF1X or IE notation. An entity relation model diagrams the relationships between data elements. This type of model is most often used to diagram on line transaction processing (OLTP) systems.


dimensional model

A model that diagrams the facts and dimensions of a business process in a star schema. This type of model is most often used to diagram data warehouse databases. Dimensional modeling (DM) is available as a physical methodology.


dimension table

Dimension tables are the satellite, or minor, tables in a dimensional model. Dimension tables have identifying parent relationships to the fact table and can have child relationships with other dimension or outrigger tables.


datatype

A predefined set of characteristics for a column that specifies field length, acceptable characters, and optional and required parameters. For example, char(18) specifies that the column can store up to 18 alpha and numeric characters.


DataWindow

A PowerBuilder DataWindow is a control that lets you display and manipulate data from a data source.


DataWindow Wizard

A set of dialogs that let you use information from an ERwin diagram as a data source for a PowerBuilder DataWindow.


default/initial value

A column property that sets a default or initial entry in a column if a user does not enter a value; a column can be assigned different default values for the server and client.


dependent entity

An entity whose instances cannot be uniquely identified without determining its relationship to another entity or entities.


discriminator

An attribute whose values are used to determine the subtypes of the instance. For example, the value of the attribute "gender" in an instance of "employee" determines to which particular subtype (male-employee or female-employee) that instance belongs.


display format

A column property that lets data be displayed in a different format from how it is stored; for example, a data or currency value.


domain

A group of predefined logical and physical property characteristics that can be saved and attached to attributes and columns to speed model development.


edit style

A column property that determines how data is displayed in an application form; for example, as an edit field, a drop-down box, a check box, or a set of option buttons.


entity

An entity represents a set of real or abstract things (people, places, events, etc.) which have common attributes or characteristics. Entities may be either independent or dependent. The logical equivalent to a table.


ERwin dictionary

The database that is generated from the ERwin metamodel, it stores information about the data structures used in models rather than the business information stored in other databases.


ERwin Custom Control

A Visual Basic custom control that you can draw on a form to access the ERwin Form Wizard dialog.


ERwin Form Wizard

A special dialog that lets you use information from an ERwin diagram as a data source for a Visual Basic form.


ERX format

ERwin's native text file format, lets you save the information stored in a graphical data model as a text description.


extended attributes

Also called "extended column definition information," represents information you define to control the display and validation of data in a column.


fact table

The fact table is the central table in a dimensional model that contains the additive or factual data about a business. It has identifying child relationships with the dimension tables, so that its primary key is made up entirely of the primary keys of all the dimension tables.


foreign key

An attribute that has migrated through a relationship from a parent entity to a child entity.


foreign key migration

When the key from a parent entity automatically appears in the key of the child entity with the designation of (FK) for foreign key.


forward engineering

The process of generating the physical database schema from the logical data model.


guest

The ModelMart security profile that is assigned by default to new users. The Guest profile has no associated permissions.


IDEF1X

ICAM Definition Method 1 Extended. A methodology for graphically depicting entities, attributes, and entity relationships.


identifying relationship

A relationship whereby an instance of the child entity is identified through its association with a parent entity. The primary key attributes of the parent entity become primary key attributes of the child.


Information Engineering

(IE). A methodology for graphically depicting entities, attributes, and entity relationships. IE uses a different notation than IDEF1X for depicting relationships and cardinality.


incomplete subtype cluster

If the subtype cluster does not include all of the possible subtypes (every instance of the generic parent is not associated with one subtype), then the subtype cluster is incomplete. For example, if some employees are commissioned, a subtype cluster of salaried-employee and part-time employee would be incomplete.


independent entity

An entity whose instances can be uniquely identified without determining its relationship to another entity.


inheritance

When ERwin migrates a primary key attribute, by default, the foreign key created in the child entity inherits the name but not the definition of the primary key attribute. If you also want the primary key attribute's definition to migrate to the child entity, you must change ERwin's default setting.


input mask

A string of symbols that controls how you enter data in a field; for example, the mask (999) 999-9999 requires digits to be entered for a telephone number and automatically inserts the format characters and space.


instance

An occurrence of data within a table. Also called a record or a tuple.


inversion entry

An attribute or set of attributes that do not uniquely identify an instance of an entity, but are often used to access instances of entities. ERwin will generate a non-unique indexes for each inversion entry.


key

Any field or set of fields which uniquely identify an instance in a table.


library

An environment in the ModelMart that includes one or more related ModelMart diagrams and the set of library-level objects (e.g., domains, validation rules, stored procedures, etc.) shared by those diagrams.


library-level object

An object definition stored in a ModelMart library that is available to all ModelMart diagrams stored in the library. Library-level objects include: display formats, domains, edit styles, pre- and post-script templates, rollback segments, stored procedures, tablespaces, trigger templates, and validation rules.


lock mode

The current lock state of a ModelMart diagram. The possible modes are: Locked, Unlocked, or Read-Only, which correspond to the locking option chosen when the diagram is opened. A user can change the lock mode of a ModelMart diagram while working on it, unless it was opened in read-only mode or another user has a locked copy of the same diagram.


locking option

An option available when you open a ModelMart diagram. The available options are: Locked, Unlocked, or Read-Only. The Locked option gives a user exclusive rights to the master model. The Unlocked option lets users save changes to the master model in the ModelMart on a first-come-first-served basis. The Read-Only options lets you view the master model in the ModelMart, but you cannot save changes to the ModelMart.


logical level

Thinking and modeling things directly from the real world.


many-to-many

A relationship between two entities where instances in one entity have zero, one, or more related instances in the other entity, and vice versa (e.g., a many-to-many relationship exists between students and classes. Each student can attend many classes; each class can include many students).


master model

The master copy of a ModelMart diagram, which is stored in the ModelMart.


metamodel

The ERwin model that defines the data structures needed to store all the definition, location, font, color, and other required information about your diagram.


model management system

A system for storing, retrieving, versioning, and maintaining models used to support software development projects. Logic Works ModelMart is designed to be a common model management system for all Logic Works products. By letting you store ERwin, BPwin, and OOwin objects in our ModelMart, Logic Works provides an integrated environment for entity-relationship, business-process, and object-oriented model development.


modeler

A ModelMart default security profile that is typically assigned to ModelMart users that need to create, update, and delete ERwin objects in a ModelMart diagram, but are restricted from updating library-level objects.


ModelMart

A special database located on a DBMS server that stores ModelMart diagrams in SQL tables. The ModelMart also contains the stored procedures and triggers ModelMart uses tomanipulate ModelMart diagrams, and merge changes when diagrams are replicated and saved.


ModelMart Administrator

By default, the person who creates the ModelMart is automatically assigned an Administrator security profile, which gives him/her unlimited access to all ModelMart objects and lets him/her create additional users and assign their security privileges.


ModelMart Control Tables

Two special SQL tables that ModelMart uses in conjunction with several stored procedures to track ModelMart software license usage information.


ModelMart Diagram

An ERwin diagram saved in the ModelMart that can be edited on a workstation.


ModelMart License

A license that specifies the maximum number of users that can log on to the ModelMart. When it’s necessary, you can upgrade your ModelMart License to add more users.


ModelMart Model Merge

The combining of two independent ERwin diagrams into a single ModelMart diagram with one set of unique objects. ERwin eliminates redundancy between the two models by consolidating duplicate objects.


ModelMart Workgroup

The members of a modeling team who use ERwin to create and edit a shared entity-relationship model and who store a master version of that model in the ModelMart. The role of each workgroup member is defined by his/her assigned security profile (e.g., Administrator, Architect, Modeler), which may limit or grant permission to save changes back to ModelMart.


MPD ModelPro format

A type of file that stores data model information in text format.


n-ary relationship

A relationship that occurs when two or more tables are parents to a single child table. (When a single parent-child relationship exists, the relationship is called binary.)


non-key attribute

Any attribute that is not part of the entity's primary key. Non-key attributes may be part of an inversion entry and / or alternate key, and may also be foreign keys.


nonidentifying relationship

A relationship whereby an instance of the child entity is not identified through its association with a parent entity. The primary key attributes of the parent entity become non-key attributes of the child.


nonspecific relationship

Both parent-child connection and subtype relationships are considered to be specific relationships because they define precisely how instances of one entity relate to instances of another. However, in the initial development of a model, it is often helpful to identify "non-specific relationships" between two entities. A nonspecific relationship, also referred to as a "many-to-many relationship," is an association between two entities in which each instance of the first entity is associated with zero, one, or many instances of the second entity and each instance of the second entity is associated with zero, one, or many instances of the first entity.


normalization

The process by which data in a relational construct is organized in order to minimize redundancy and non-relational constructs.


null

Having no value, an "empty" or non value.


one-to-many

a relationship where each parent instance has zero, one, or more child instances.


operation

An action you can perform (i.e., create, update, or delete) on an ERwin object as specified in a security profile.


outrigger table

Outrigger tables are secondary dimension tables in a dimensional model. Outrigger tables can only be related to dimension tables, where the outrigger table is the parent and the dimension table is the child. The relationship may be identifying or non-identifying. An outrigger table cannot be related to a fact table.


owned attribute

An attribute that is not a foreign key. An owned attribute represents the primary reference to an attribute within a single model.


parent diagram

In ModelMart, a parent diagram is the only read/write version in a set of related diagrams. In addition to the parent diagram, the set  may include one or more archive versions and/or snapshots, which are read-only.


permission

An authorization granted in a security profile that lets a user perform an operation (i.e., create, update, delete) on a specific type of object (e.g., entity).


permission object class

A container object that groups ERwin objects together so that you can assign permissions to the group in a security profile. ERwin uses five permission objects classes: ModelMart, Library, Diagram, Subject Area, and Entity. When you assign a permission to an object class (e.g., Entity), you automatically assign the permission to each type of ERwin object in the object class.


physical level

Database- and DBMS-specific model information; e.g., tables, columns, datatypes, etc.


physical storage object

A named partition or area on a storage device used to store object definitions and/or data.


pre/post script

SQL scripts that you want ERwin to execute immediately before or after the rest of the schema is generated.


primary key

1) An attribute or attributes that uniquely identify an instance of an entity.

2) If more than one attribute or group of attributes satisfies rule 1, the primary key is chosen from this list of candidates based on its perceived value to the business as an identifier. Ideally, primary keys should not change over time, and should be as small as possible.

ERwin will generate a unique index for each primary key.


recursive relationship

A relationship that exists when instances in a table have a relationship with other instances in that same table (e.g., in the EMPLOYEE table, an employee can manage other employees).


referential integrity

(RI). The assertion that the foreign key values in an instance of a child entity have corresponding values in a parent entity.


referential integrity trigger

A trigger that is used to maintain integrity between two related tables.


refresh

The ability to update an open ModelMart diagram with changes saved to the master model in the ModelMart during a modeling session. While you are working on a ModelMart diagram, ERwin lets you import changes made by others to keey your copy of the model current, and lets you review and compare your changes with information already saved to the master model in the ModelMart.


relationship

Represent connections, links or associations between entities.


restrict

A referential integrity option that prohibits the deletion of a parent instance if one or more dependent child instances exist.


reverse engineering

The process of generating a logical model from a physical database.


revert

The process of resetting the master model in the ModelMart to the state captured in an archive version of a ModelMart diagram. By overwriting the ModelMart master model in the ModelMart with a specific archive version, you can rollback (undo) changes made to the master model.


role

Dimensional modeling roles are automatically assigned to each table in a dimensional model based on the table’s relationships to other tables. A table may be a fact table, a dimension table, or an outrigger table based on its role.


rolename

A new name for a foreign key. A rolename is used to indicate that the foreign key performs a specific function (or role) in the entity.


schema

The structure of a database. Usually refers to the DDL (data definition language) script file. DDL consists of CREATE TABLE, CREATE INDEX, and other statements.


security profile

A set of permissions that you can assign to one or more ModelMart users. You can assign different security profiles to a user for different permission objects (i.e., ModelMart, Library, Diagram, Subject Area) in the ModelMart.


session

A period of time in which a user has one or more ModelMart diagrams open or locked.


set null

A referential integrity option that automatically sets the foreign key of a child instance to null when the parent instance is deleted.


SML format

A special type of file designed to store information about an Entity-Relationship model in text format.


snapshot

A special version of a ModelMart diagram that records the status of the diagram when you opened it. ERwin uses the snapshot as a baseline to track your changes and generate a transaction list that shows the changes made to a model when you attempt to save your copy of the ModelMart diagram back to the master model in the ModelMart. You can also create a snapshot when you save an ER1 version of a ModelMart diagram to work on off-line. Later, when you want to merge your changes into the ModelMart diagram, ModelMart uses the snapshot to compare your changes, and the changes made by other users, to the master model in the ModelMart.


source diagram

The diagram that contains the objects that will be merged into a target diagram when you merge two diagrams. When the merge is complete, the source diagram is unaltered.


specific relationship

A specific relationship is an association between entities in which each instance of the parent entity is associated with zero, one, or many instances of the child entity.


stored display

An alternative presentation of a Subject Area or model that highlights a particular aspect of the total data structure. A Stored Display includes all the objects in the parent Subject Area or model, but the objects may positioned differently and the diagram can be set to a different display level.


stored procedure

A block of SQL Code, similar to a trigger, that is stored on the server for quick execution. It resembles a trigger except it is invoked by another program that passes the procedure name to the server.


subject area

A named version of a data model that may include all the entities, relationships, subtypes, and text blocks, or any subset of the objects in the complete data model.


subtype entity

In the real world, we often encounter entities which are specific types of other entities. For example, a salaried employee is a specific type of employee. Subtype entities are useful for storing information that only applies to a specific subtype. They are also useful for expressing relationships that are only valid for that specific subtype, such as the fact that a salaried employee will qualify for a certain benefit, while a part-time-empoyee will not.

In IDEF1X, subtypes within a subtype cluster are mutually exclusive.


subtype relationship

A subtype relationship (also known as a categorization relationship) is a relationship between a subtype entity and its generic parent. A subtype relationship always relates one instance of a generic parent with zero or one instance of the subtype.


synchronizing

The process of comparing an ERwin model with an existing database, and updating the model, the database definition, or both to ensure that they are identical.


target diagram

The diagram in which the source diagram objects are merged when you merge two diagrams. When the merge is complete, the target diagram contains all the unique objects from both the source and the target diagrams.


target server

DBMS in which the physical schema is created.


template

Skeletal SQL code and macros that flesh the code out with table names and other variables when the physical database schema is generated.


trigger

A named set of precompiled SQL statements stored on the server that is automatically executed when a specified event occurs.


unification

The merging of two or more foreign key attributes into a single foreign key attribute based on the assertion that the values of the original foreign key attributes must be identical.


valid value

One item in a fixed list of all the acceptable values that can be stored in a column; the list can be assigned to a validation rule for control of data entry; a class style can be applied to present the valid values as a combo box or as a set of option buttons.


validation rule

A column property that restricts what values can be stored in a column. A column can be assigned different validation rules for the server and client.


version comparison

The process of comparing differences between an earlier version (archive version or snapshot) and a parent diagram. Optionally, you can revert back to an earlier version by saving a version under the same name as the parent diagram.


viewer

A ModelMart default security profile that is typically assigned to users who should be able to view, but not alter ModelMart diagrams.


Technical Support Policy

If you encounter any problems while using ERwin, you can:

•	Access context-sensitive help for the feature you are currently using by pressing F1.

•	Read the Frequently Asked Questions (FAQ) document which is installed with ERwin and has its own icon. FAQ documents are also posted in the Logic Works forum library on CompuServe and on our World Wide Web site at http://www.logicworks.com.

If you cannot find the solution to your problem using the option described above and you would like to speak to a technical support analyst, please contact Logic Works Technical Support.

Logic Works offers the following forms of electronic support to all customers:

Electronic Support for Customer Use

Contact Method	Address
CompuServe E-mail:	70262,1135
CompuServe Forum:	GO LOGICWORKS
Internet:	http://www.logicworks.com
Internet E-mail:	support@logicworks.com
Customers in the United States, Canada, and Europe can receive technical support by telephone or fax using the contact numbers in the table below.

Technical Support Contact Numbers

Contact Method	United States and Canada	Europe
Telephone:	(609) 514-2020	+44-171-412-2150 (United Kingdom) +49 40 23 78 860 (Germany)
Fax:	(609) 514-2868	+44-171-412-0130 (United Kingdom) +49 40 23 78 8699 (Germany)
Technical support is available in the United States between 9 a.m. and 7 p.m. Eastern Time, and is free of charge for the first 45 days. It is also available after the warranty expires, as long as you have purchased a maintenance plan. Please refer to your license agreement for further information about technical support.

When you contact Logic Works Technical Support, please have the following information ready for the support analyst:

•	The license code of the product you are using (printed on the right sleeve of the compact disc holder).

•	The version number and the build number of the product (available from the About ERwin menu option on the Help menu).

•	The operating system or platform (for example, Windows NT 3.51).

•	The target database.

•	A description of the problem, the steps to reproduce the problem, and any error messages.

Note:	If you live outside the United States, Canada, or Europe, contact the distributor from which you purchased your copy of ERwin to obtain technical support by telephone or fax.


Customer Service

If you need any information about Logic Works products, software upgrades, or maintenance plans, or if there is any problem with your product when you receive it, please contact Logic Works at the number shown below and ask for Customer Support:

• : 1-800-78ERWIN (1-800-783-7946)

Your product package should include information about the Logic Works comprehensive maintenance plans, which provide many benefits. The most important benefits are:

•	While your maintenance plan is in effect, you receive free product upgrades as they become available. Logic Works guarantees a minimum of one maintenance upgrade per year. As a Maintenance Plan subscriber, you can request automatic renewal of the plan or you will be notified 30 to 60 days in advance of the expiration date of your maintenance plan.

•	Your maintenance plan entitles you to additional support on the Logic Works Technical Support line. See Technical Support Policy for more information.


New Dialog

ERwin provides the New dialog so that you can create new objects in many of the ERwin editors. When you open an ERwin editor and click the New button, ERwin displays the New dialog.

In addition to letting you name a new object, some versions of the New dialog also let you specify important parameters for the new object. For more information, click on the object you want to create in the list below:

•	Attribute, column, or domain

•	Key group or index

•	Relationship

•	View column


Using the New Dialog in the Attribute, Column, and Domain Editors

The New dialog contains two text boxes, which let you enter or edit the name of the object as you want it to appear in the logical model and the physical model. For example, when you click New in the Attribute Editor, the New dialog contains the Attribute and Column text boxes. You can enter a name for the new attribute in the Attribute text box, and optionally enter a different name for the column in the physical model that corresponds to the new attribute.

The purpose of each control in the Name group box is explained below:

•	Attribute, Key Group, or Logical. Enter or edit the logical name for the object.

•	Column, Index, or Physical. Enter or edit the physical name for the object.


Using the New Dialog in the Index and Key Group Editors

The New dialog contains two text boxes, which let you enter or edit the name of the key group/index as you want it to appear in the logical model and the physical model.

The purpose of each control in the Name group box is explained below:

•	Key Group. Enter or edit the logical name for the object.

•	Index. Enter or edit the physical name for the object.

When you open the New dialog from the Index Editor, it contains the Unique check box. Select the check box to create a new unique index; clear the check box to create a non-unique index.

When you open the New dialog from the Key Group Editor, it contains additional two buttons, Alternate key (unique) and Inversion entry (non-unique). Select the appropriate option for the new key group.


Using the New Dialog in the Relationship Editor

The purpose of each control in the New Relationship dialog is explained below:

•	Parent. Select the parent entity or table for the new relationship.

•	Child. Select the child entity or table for the new relationship.

•	Identifying. Click this button to create an identifying relationship (the foreign key migrated through the relationship appears in the primary key of the child entity or table).

•	Non-Identifying. Click this button to create an non-identifying relationship (the foreign key migrated through the relationship appears in the non-key area of the child entity or table).

•	Many-to-Many. Click this button to create a many-to-many relationship (no foreign key migration). This option is available in the logical model only.


Using the New Dialog in the View Column Editor

The purpose of each control in the New View Column dialog is explained below:

•	Name. Type a name for the new view column.

•	Expression. Enter an expression for the new view column. An expression is used to derive information (such as a product or sum) from other columns in the view.


Rename Dialog

ERwin provides the Rename dialog so that you can rename objects in the ERwin editors. When you open an ERwin editor and click the Rename button, ERwin displays the Rename dialog.

When you click Rename in an editor in the logical model, you can edit the name of the object in the logical model and view the name of the object in the physical model.

When you click Rename in an editor in the physical model, you can view the name of the object in the logical model and edit the name of the object in the physical model.

Note:	The Rename option is not available in the Relationship Editor. You can rename a relationship using the controls in the General tab or use on-diagram editing.


MOVIES.ER1 Physical Model


MOVIES.ER1 Logical Model


Selecting a Target Server

Choose from the following help topics for more information on choosing a target server for the existing ERwin model, or when accessing the ERwin Dictionary:

•	Selecting the Target Server That Contains the ERwin Dictionary

•	Choosing a Target Database and Setting ERwin Defaults

•	Using the Dictionary Manager


ERwin Macro Help

You can use ERwin macros in the templates you create for triggers, stored procedures, and pre- and post- schema generation scripts when these features are supported by the target DBMS.

All macros, except those specifically noted in the ERwin Macro Reference, can be used on all of the target servers supported by ERwin. See your server documentation for detailed information on its support for RI triggers, stored procedures, and/or scripts.

The macro reference information is organized alphabetically by macro name. The information for each macro includes a description, macro syntax, the scope of the macro (i.e., the statements or code segments in which it can be used), the return value; and, typically, an example of the macro template code and corresponding expanded code.

  Click here to open Macro.hlp.


Contacting the Logic Works Documentation Department

The Logic Works Documentation Department is always interested in your comments on documentation:

•	Do you find the documentation useful?

•	Do you have questions about specific areas or topics within the documentation?

•	Are there problems in the documentation that you would like to report?

•	What is your overall rating of the documentation?

Contact the documentation department and send comments at any time by:

 Electronic comments form. If you have access to a supported Internet Browser (Netscape, Microsoft Internet Explorer, or Mosaic), you can click the button to the left to access the online documentation comments form. Simply complete the form and click the Submit button on the form.

 Fax or U.S. mail. Complete a Documentation Comments Form that you can view and print by clicking on the icon to the left. There are also comment forms that appear at the end of each printed ERwin guide. You can then fax or mail it to:

Documentation Manager

Logic Works, Inc.

University Square at Princeton

111 Campus Drive

Princeton, New Jersey 08540

Fax: (609) 514-0184


Documentation Comments Form

Fax Cover Sheet

The Logic Works Documentation Department values the comments and suggestions that you have on our documentation. To print the fax cover sheet and comment form from here, click the Print button on the button bar above, complete your comments and fax it to the number on the cover sheet. We will review your comments and suggestions to evaluate how we can incorporate them into future versions of the documentation. Thank You!

Date:

Number of Pages Including Cover:

TO:

Name:	Documentation Manager

Company:	Logic Works

Fax:	(609) 514-0184

Phone:	(609) 514-1177

FROM:

Name:

Address:

Phone:

DETAILS:

Product and Version No.:

Name of guide or online help system:

Topic or Subject:

Documentation Comments Form

COMMENTS:

Please enter your comments in the space provided below:

OTHER SPECIFICS:

1) Would you like a Logic Works representative to contact you?	Yes · 	No

2) Does the online index help you find the information you need?	Yes · 	No

Please explain:

3) Do you use the context-sensitive help (F1)?	Yes · 	No

Is it helpful? Please explain:

4) How often do you use the online contents to navigate the help system?

5) How often do you use the online conceptual topics?

6) How often do you use the online procedural topics?

7) If there is one thing we could do to improve the usefulness of our documentation, what would it be?

  8) Can we contact you about our documentation?	Yes · 	No

Please fax or mail completed forms to:

Documentation Manager
Logic Works, Inc.
University Square at Princeton
111 Campus Drive
Princeton, NJ 08540

Fax: (609) 514-0184


ERwin 3.5 Release Notes Addendum

This addendum supplements the printed ERwin 3.5 Release Notes.

•	The Schema Generation options added for ERwin 3.5 are:

Schema Generation Class	Option	Database(s)
Table Option	Partitions	Oracle 8.x
	Drop Procedure	Progress 4GL
Index Option	Drop PK,AK,FK,IE	DB2/MVS, DB2/CS, Informix, Ingres, InterBase, Oracle, OpenIngres, Rdb, Red Brick, SQL Anywhere and WATCOM, SQLBase, SQL Server, and SYBASE
View Option	Create and Drop Procedure	InterBase, ORACLE, OpenIngres, SQL Anywhere & WATCOM, SQLBase, SQL Server, and SYBASE
	Create and Drop Macro	Teradata
•	Throughout the ERwin documentation, substitute the server DB2/CS where DB2/2 is stated.

•	The %ColDomain has been added to the ERwin macro family. This macro functions similarly to the %AttDomain macro, except that it applies to column domains instead of attribute domains. See the %AttDomain macro in the Macro.hlp file for more information.

•	The documentation incorrectly references the BPsyncER item in the Logic Works ERwin ERX 3.5 program group. The correct name for this item is the ModelMart Synchronizer.


Open ERwin Online Help

•	To open the ERwin Online Help contents, choose ERwin Online Help from the Help menu.


Open ERwin Topic Index

•	To open the online help topic index, choose Topic Index on the Help menu.


Open ERwin Tutorial

•	To open the ERwin online tutorial, choose ERwin Online Tutorial on the Help menu.


Open How to Use Help

•	To open How to Use Help, choose How to Use Help on the Help menu.


Basic ERwin Features

ERwin has many powerful features that let you design entity relation data models and dimensional models. With ERwin you can create and maintain databases on many different target servers. But perhaps ERwin’s most powerful feature is its simplicity and ease of use.

ERwin uses many of the standard Windows features and conventions. Just as you can create, modify, save, and print documents in other Windows applications, you can perform these same tasks in ERwin using familiar Windows dialogs.

To understand the full scope of ERwin’s features and capabilities, you can open the Movies.er1 sample file, which is automatically installed with ERwin. This model includes all the typical objects and properties that you may want to include in your own data models. Throughout the ERwin Online Help system, some of ERwin’s features are illustrated using the Movies.er1 file as an example. Click on, Sample Movies.er1 Logical Model or Sample Movies.er1 Physical Model, to look at the logical and physical views of the sample model in a help window.

Basic ERwin features include:

•	Creating a New ERwin Diagram

•	Selecting a Template for a New Diagram

•	Opening an ERwin Diagram

•	Saving an ERwin Diagram

•	Using PVCS Version Control Software

•	Printing an ERwin Diagram

•	Closing an ERwin Diagram

Related Topics

  Welcome to the ERwin Workplace


Creating a New ERwin Diagram

When you start ERwin, a blank diagram window is automatically displayed so you can immediately begin creating a new data model. Click on a help topic below to learn how to use some of ERwin’s basic features as you design your new entity relation data model or dimensional model.

ERwin Feature Help Topic:	ERwin Feature Description
Selecting a Template for a New Diagram	To save time, you can also start working from a template that you or others in your workgroup have created. When you create a diagram from a template, all the objects and display settings in the template are automatically applied to the new diagram.
Working With Subject Areas and Working With Stored Displays	For each new diagram, ERwin also automatically creates a subject area (Main Subject Area) and a stored display (Display 1) for you to begin your work. You can create additional subject areas and stored displays that are specific to your modeling needs.
Using ERwin’s Logical and Physical Modeling Features	You can create a new diagram in either the logical or physical model. Generally, every object in the logical model has a corresponding object in the physical model. ERwin automatically keeps the objects in both models in sync, unless you specify that a particular object appear in only one model.
ERwin Toolbox	When you are ready to add objects to your data model, you simply click on a tool in the ERwin toolbox and drag it to the diagram window.
Using On-Diagram Editing	ERwin has a powerful on-diagram editing feature that lets you quickly name objects without opening an editor.
Setting ERwin Diagram Preferences	You can customize your working environment using ERwin’s many display options and diagram preferences. You can also choose to create your diagram using IDEF1X or IE notation.
Choosing a Target Database_ and Setting ERwin Defaults	In the physical model, ERwin customizes the available options based on the characteristics of the selected target database such as datatypes, null options, physical storage parameters and triggers. Once this model is defined, ERwin can generate it to your target database directly, in the exact syntax required by your DBMS.
Forward and Reverse Engineering	You can also create a new model by reverse engineering an existing database.
Related Topics

  To create a new ERwin diagram

  Opening an ERwin Diagram

  Saving an ERwin Diagram


To create a new ERwin diagram

1.	Select the New option from the File menu.

2.	Choose a blank diagram or template from the ERwin Template Selection dialog.

3.	Click OK.

4.	Use the toolbox to add objects. Use the ERwin editors to add and change properties to the diagram objects.

5.	Click [image] to save the diagram. More>>


Selecting a Template for a New Diagram

In ERwin, a template can store diagram objects, display settings, and preferences. Any model can be saved as a template to save its settings and contents for quick reuse. In this way, templates provide the ideal way of maintaining a consistent look and feel across different models. After you save a template, you can use it as the basis for creating new diagrams.

When you choose New on the File menu, click the New button on the ERwin Toolbar, or choose Reverse Engineer on the Tasks menu, ERwin displays the ERwin Template Selection dialog.

The purpose of each control in the ERwin Template Selection dialog is explained below:

•	Template. Lists the available templates. Select the template that you want to use to start a new diagram.

•	If you choose Blank Diagram and click OK, ERwin opens a new diagram and uses ERwin default settings.

•	If you choose DIMENS and click OK, ERwin opens a new diagram in the physical model and uses the dimensional modeling template settings. ERwin automatically sets the physical modeling methodology to DM (Dimensional Modeling) and selects the Display conformance warnings check box, displays diagonal relationship lines without cardinality, and displays dimensional icons for tables.

•	If you choose PROGRESS and click OK, ERwin opens a new diagram that contains pre-defined scripts (.w files), server values (PROGRESS formats), defaults, and validation rules for use with a PROGRESS 4GL target server.

•	If you choose any other template and click OK, ERwin opens a new model and applies the diagram settings and ERwin objects from the selected template.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

•	Remove. Removes the selected template from the list. The template file (*.ERT) is not deleted.

•	Browse. Click this button to open the ERwin File Open dialog and select the template that you want to use for the new diagram.

•	ModelMart. Click this button to open the Open ModelMart Diagram dialog and select the template that you want to use for the new diagram. This option is available only if you are connected to a ModelMart. See ModelMart Diagram Templates for more information.

Note:	You can also save ERwin diagram templates in the ModelMart. See To save a ModelMart diagram as a template for more information.
ERwin includes a sample template file, SAMPLE.ERT, which is installed in the same directory as the ERwin program files.

Related Topics

  To create a new ERwin diagram

  Creating a New ERwin Diagram

  Opening an ERwin Diagram

  Saving an ERwin Diagram

  Forward and Reverse Engineering


To save a diagram as a template

1.	Choose the Save As option from the File menu to open the ERwin Save As dialog.

2.	Choose the ERT option in the File Format group box, if not already selected.

3.	Type the template name in the File Name text box.

4.	Click OK.

Note:	ERwin saves the settings and content of the file to the .ERT file. The file is not saved as an .er1 file.


Opening an ERwin Diagram

At any time, you can open an existing diagram by selecting the Open option on the File menu, and using the ERwin Open File dialog to select the file you want to open.

The purpose of the controls on the ERwin Open File dialog are explained below:

•	File Name.  Type the name of the file. You can use * as a wildcard. For example, you can type *.* to see a list of all files. You can also type the full path of a file. For example, you can type c:\ERwin30\Model1.er1. If you see the file in the list, double-click on it to open it.

•	Folders. Lists the folders that you can access on the selected drives. Double-click on the folder to locate the file you want to open.

•	Files of Type. Lists the types of files that ERwin can open. Only the files matching the file type you select appear in the list. For a list of file types that ERwin can open, see ERwin Support for Different File Types for more information.

•	Drives. Select the drive on which the file you want to open is located.

•	Network. Opens the Map Network Drive dialog in which you can map a drive letter to a specific network path. The mapped drive letter is available from the Drives list in the Save As dialog.

•	OK. Click to open the selected file.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To open an existing ERwin file


To open an existing ERwin file

1.	Choose Open from the File menu.

2.	Locate the drive and the folder that contains the file you want to open. Double-click on the folders in the Folders list to switch to a different folder. If necessary, switch to a different drive by selecting a drive from the Drives list.

3.	Locate the file you want to open. Type the name of the file in the File Name text box or select it from the File Name list.

4.	Click OK.

Note:	If ERwin is not running, you can drag the file name from the File Manager or Explorer and drop it on the ERwin icon to open the file.


Saving an ERwin Diagram

The File menu offers two saving options, Save and Save As. Use the Save option or click [image] on the toolbar to save the current diagram under the file name shown in the window title bar. Use the Save As option when you want to save the diagram under another file name or in a different file format. When you choose the Save As option from the File menu, ERwin displays the Save As dialog.

The purpose of the controls on the Save As dialog are explained below:

•	File Name. Type the name that you want to assign to the saved file. You can select a name from the list if you want to replace the existing file with the one you are saving.

•	Folders. Lists the drives and folders that you can access. Double-click on the folder to select the location where you want to save the file.

•	Files of Type. Lists the types of files that ERwin can save. See ERwin Support for Different File Types for more information.

•	Drives. Select the drive where you want to save the file.

•	File Format. Select one of the following file formats in which to save the file:

•	ER1. This format is the standard ERwin graphic diagram format. Whenever you save a .er1 file, the previous version of the file is saved with the same name as a .BK1 file.

•	ERT. This format is a template file that stores all of the current diagram graphical characteristics, diagram objects and their properties as a template for use in another diagram.

•	ERX. This format is a text description of an ERwin diagram that is used to export an ERwin model to another application. Generally, .er1 is used to build a diagram and the ERX file format is used to export the diagram. See Using ERwin’s Native Text Format for more information.

•	ERX & Multiple. This control lets you save an ERwin diagram in multiple ERX text files rather than one large file. Each text file contains information about a specific data section of the ERwin diagram. See Saving Files in ERX and Multiple Format for more information.

•	OK. Saves the ERwin diagram in the selected folder and drive.

•	Cancel. Closes the dialog and cancels any changes.

•	Network. Opens the Map Network Drive dialog in which you can map a drive letter to a specific network path. The mapped drive letter is available from the Drives list in the Save As dialog.

•	Expand. Opens the Expand Property Values dialog in which you can specify the logical and physical inheritable properties, such as column name, that you want to save text values for instead of null values. This button is only visible when you select the ERX or ERX & Multiple format.

Related Topics

  To save a diagram

  Saving a Diagram as an ERwin 2.6 ER1 File

  ERwin Support for Different File Types

  Selecting a Template for a New Diagram


To save a diagram

1.	Choose either Save or Save As from the File menu.

2.	Accept .er1 as the default file format or click another file format button to select a different format type.

3.	Type the file name for the diagram you are saving in the File Name text box.

4.	Click OK.

Note:	You can also click [image] on the ERwin toolbar to open the Save or Save As dialog.


Saving a Diagram as an ERwin 3.0 ER1 File

ERwin 3.5 is backward compatible. That means, you can open a diagram created in the previous version of ERwin, but you cannot open a diagram created in ERwin 3.5 in ERwin 3.0.

If you are sharing models created in ERwin version 3.5 with ERwin version 3.0 users, you can save your diagram as an ERwin version 3.0 diagram.

Related Topics

  To save a diagram as an ERwin 3.0 ER1 file


To save a diagram as an ERwin 3.0 ER1 file

1.	Choose the Save As option from the File menu to open the ERwin Save As dialog.

2.	Choose the ER1 option in the File Format group box, if not already selected.

3.	Type the file name in the File Name text box.

4.	Select ERwin 3.0 (*.er1) in the List Files of Type list.

5.	Click OK.


ERwin Support for Different File Types

ERwin can open and save data model information in several different file types. The file types you can open in ERwin are shown in the List Files of Type list box in the lower left corner of the Open File dialog.

The file types you can open in ERwin are as follows:

•	ER1. Standard ERwin diagram file format. ERwin version 2.6 .er1 diagrams are also supported.

•	ERX. Text-based version of ERwin diagram file format. ERX files created with an earlier version may not open in a newer version of ERwin. To maintain the diagram, convert ERX files to ER1 files when upgrading to a new version of ERwin.

•	ERT. ERwin diagram file saved as a template. See Selecting a Template for a New Diagram for more information.

•	ERV. ERwin diagram saved as an Intersolv PVCS archive file. You must have Intersolv’s PVCS version 5.1 or later installed to open an ERV file. See Using Intersolv's PVCS for Version Management for more information.

•	BPX. A filename with this extension is a business process model from Logic Works’ BPwin business process modeling tool. This text file contains entity, attribute, and activity names from a BPwin model. ERwin reads the data and performs a BPwin model import. See Importing BPwin Entities, Attributes, and Activities for more information.

•	ERS. ERwin physical database schema script text file. When you open a text file with this extension, ERwin reads the data structure specified in the text file and automatically reverse engineers the database and creates a matching data model diagram.

•	SQL. SQL DDL (Data Definition Language) schema script text file. When you open a text file with this extension, ERwin reads the data structure specified in the text file and automatically reverse engineers the database and creates a matching data model diagram.

•	SML. Structured Modeling Language text file. See Working With the Structured Modeling Language (SML) for more information.

•	CMT. Text file containing logical entity/attribute and physical table/column definitions (comments). You must open a diagram before you can open the associated comment file.

•	DF (SQL). Progress data definition text file. When you open a text file with this extension, ERwin reads the data structure specified in the text file and automatically reverse engineers the database and creates a matching data model diagram.

•	DBF. A filename with this extension is a database file in dBASE format. When you open a DBF file, ERwin automatically reverse engineers the database and creates a matching data model diagram.

•	MDB. A filename with this extension is a database file in Microsoft Access format. When you open a .mdb file, ERwin automatically reverse engineers the database and creates a matching data model diagram.

Note:	In addition to the file types listed above, ERwin lets you store data models in a ModelMart, or in a PC- or SQL-based dictionary. See Using the ERwin Dictionary, and Saving ERwin Diagrams in the ModelMart Environment for more information.

Related Topics

  Using Intersolv's PVCS for Version Management

  Saving an ERwin Diagram

  Selecting a Template for a New Diagram


Using Intersolv's PVCS for Version Management

If you have Intersolv’s PVCS (version 5.1 or later) version control software installed on your PC, you can use it to manage changes and report on differences between different versions of an ERwin data model. PVCS tracks the changes to an ERwin model and notes the author who performed the changes. PVCS stores each version in an archive file and controls access to the data. PVCS can also lock a data model to allow only one user at a time to access a specific version.

Related Topics

  To create a PVCS archive

  To open a PVCS archive


To create a PVCS archive

1.	Verify that PVCS is installed and running on your PC, and the PVCSVMW.DLL file is in the DOS path or ERwin directory.

2.	Choose Save As from the File menu to display the Save As dialog. Then check the PVCS Put button.

3.	Accept the .er1 default file format or select .erx.

4.	Type the model name in the File Name box. ERwin automatically assigns the .ERV file name extension.

5.	Click OK.

6.	Refer to the PVCS Version Manager Reference Guide to continue working with PVCS.

Note:	The selected file format that you select in Step 3 must remain constant through the model life.


To open a PVCS archive

1.	Verify that PVCS is installed and running on your PC, and the PVCSVMW.DLL file is in the DOS path or ERwin directory.

2.	Choose Open from the File menu to display the ERwin Open File dialog.

3.	Select ERwin PVCS (*.ERV) from the List Files of Type list box.

4.	Select a file from the list of file names and click the OK button to display the Logic Works ERwin-PVCS Get dialog.

5.	Refer to the PVCS Version Manager Reference Guide to continue working with PVCS.


Printing an ERwin Diagram

When you select the Print option on the File menu, ERwin displays the Print Model dialog.

The Print Model dialog includes an embedded diagram window that lets you view the data model, specify which objects print on each page, adjust the print scaling, and select the pages that you want to print.

The purpose of the controls on the ERwin Print Model dialog are explained below:

•	Print All Pages. Click this control to print the entire diagram.

•	Print Selected Pages. Click this control to print a single page or selected pages. Click in the grid area to select the page you want to print. To select multiple pages, use the SHIFT or CTRL key in combination with the left mouse button. ERwin displays selected pages in reverse video (for example, black background with the diagram objects outlined in white).

•	<Size Diagram>. ERwin also lets you control the size of the diagram objects on the printed page. To adjust the page boundaries, click on any grid line and drag the grid. When you move the grid to adjust the page boundary, ERwin automatically reduces or enlarges the diagram’s print scale.

•	Print Scaling. Alternatively, you can specify the print scale by typing a percentage value in the text box. For example, if you enter 200%, ERwin prints the diagram two times larger than normal magnification.

•	Reset Scale. Click this button to reset the model scale to 100%.

•	Fit Model. Click this button to fit the entire model on one printed page.

•	Print. Click to print the diagram according to your specifications. ERwin changes each grid page color to yellow during printing and returns it to white when it’s finished printing.

•	Cancel. Closes Print dialog. May not cancel printing if the print job is already in the print queue.

•	Print Border. Click this check box to print a border around the ERwin diagram.

•	Print Color. If you added color to enhance your diagram and you have a color printer, ERwin can print the diagram using the colors you have selected. Click this check box after you select the pages you want to print. See Enhancing the Appearance of an ERwin Diagram for more information.

•	Copies. This group box defaults to one copy. To print two diagram copies, click the 2 control. To print more than two copies, click the more control and designate the number of copies in the text box. To turn off the collate feature, click the Collate check box to remove the X.

•	Collate. Select this button if you want the printer to collate the copies as they are printed. This option is available only if you print 2 or more copies.

•	Page Setup. Click this button to open the Page Setup dialog. You can then define page margins and specify the content of page headers and footers.

The size of a diagram file, the speed and capacity of the CPU, and the type of printer you use are all factors that impact how quickly a diagram prints.

Related Topics

  To print a diagram from ERwin

  Adjusting Page Boundaries

  Setting the Page Margins

  Adding Headers and Footers to the Diagram

  Using the Print Setup Dialog


To print a diagram from ERwin

1.	Click [image] to open the Print Model dialog.

2.	Click the Print All Pages button at the top of the dialog to print the entire diagram or click on the pages that you want to print. ERwin displays the selected pages in reverse video.

•	To print multiple contiguous pages, hold down the SHIFT key while you click the left mouse button.

•	To print multiple non-contiguous pages, hold down the CTRL key while you click the left mouse button.

3.	If you have a color printer and you have applied color to the diagram, select the Print Color check box to print the diagram with the colors you applied.

4.	If you want a border around each diagram page, click the Print Border check box.

5.	By default, ERwin prints one copy of each selected page. If you want to print:

•	Two copies, click the button labeled 2.

•	More than two copies, type the exact number that you want to print in the More text box in the Copies group box.

6.	If you are printing multiple copies, specify if you want the copies collated or not.

•	To collate, select the Collate check box.

•	To print without collating, clear the X from the Collate check box.

7.	Click the Print button. ERwin starts to print immediately. ERwin temporarily changes the each page color to yellow in the Print Model dialog to let you know the page is printing.

Note:	ERwin lets you set separate print values (e.g., adjust the grid, set the margins, add headers/footers, etc.) for each stored display in the diagram. See Working With Stored Displays for more information.


Adjusting Page Boundaries

By adjusting the page grid boundary lines, you can control how much diagram information prints on each page. The page grid boundary lines define the individual pages on which the diagram objects will print. Using your mouse, you can drag the page grid lines in the Print Model dialog or in the Diagram window itself, so more or fewer objects are printed on a particular page. To adjust the page grids from the diagram window, you must first turn them on by selecting the Page Grid option in the Option menu. You can turn off the page grids in the same way.

When you adjust the page boundary lines, the size of the page grid also determines the print scale (the size of diagram objects and fonts). To enlarge the print scale, reduce the size of the grid. To reduce the print scale, enlarge the size of the grid.

You can also specify the print scale value to adjust the size of the objects on the printed page. Type a value in the Print Scaling text box at the bottom of the dialog and ERwin automatically adjusts the print size of the objects on the page.

If you want to print the entire data model on one page, click the Fit Model button at the bottom of the Print Model diagram.

To return the model to its original size, choose the Reset Scale button at the bottom of the dialog.

Note:	The paper size you select determines the dimensions of the page grid. To change the paper size, choose the Print Setup option on the File menu and select a different paper size option. See Using the Print Setup Dialog  for more information.

Related Topics

  To adjust the page grid boundaries for printing

  To specify an exact print scale value

  To print a diagram on one page


To adjust the page grid boundaries for printing

1.	Choose the Print option on the File menu to open the Print Model dialog.

2.	Click on a page grid line.

•	ERwin changes the cursor to [image] or to [image] to let you know the direction that you can move the grid. Drag the grid line horizontally or vertically to adjust the size of the grid.

3.	When you are ready to print, select the pages you want to print and click the Print button.

Note:	Since you can also move objects in the Diagram window, you may prefer to adjust the diagram layout and the page boundaries before you choose the Print option in Step 1.


To specify an exact print scale value

1.	In the Print Model dialog, type the print scale value that you want to apply to the objects in the diagram in the Print Scaling text box.

•	To enlarge the size of diagram objects, type a value greater than 100%.

•	To reduce the size of diagram objects, type a value less than 100%.

2.	Click the TAB key. ERwin immediately changes the size of the diagram to reflect the print scale value that you specify.

3.	Click the Print button.

Note:	To reset the diagram to 100% print scale, click the Reset Scale button in the Print Model dialog.


To print a diagram on one page

1.	In the Print Model dialog, click the Fit Model button at the bottom of the dialog. ERwin automatically reduces the diagram to fit on one page.

2.	Click the Print button to start printing.


Setting the Page Margins

By default, ERwin uses the entire page for printing. Before you print, you can set separate page margins (top, bottom, left, and right) for the current stored display.

When you click the Page Setup button in the Print Model dialog, ERwin displays the Margins section of the Page Setup dialog.

The purpose of the controls in the Margins tab in the Page Setup dialog is explained below:

•	Left. Type the left margin value in inches.

•	Right. Type the right margin value in inches.

•	Top. Type the top margin value in inches.

•	Bottom. Type the bottom margin value in inches.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

•	Apply. Applies your page settings without closing the Page Setup dialog.

•	Help. Click for online help.

Related Topics

  Adding Headers and Footers to the Diagram.

  To change the margin settings

  Printing an ERwin Diagram


To change the margin settings

1.	Click the Page Setup button in the Print Model dialog.

2.	In the Margins tab, type a new value in any of the margin text boxes (Left, Right, Top, or Bottom). To enter a fraction, place the cursor after the decimal point and type the decimal equivalent. For example, enter 0.5 for ½.

3.	Click the OK button.

Note:	If you want to enter or edit the Header/Footer text before you close the Print Model dialog, click Apply to save the margin settings and then click the Header/Footer tab.


Adding Headers/Footers to the Diagram
Adding Headers and Footers to the Diagram

ERwin lets you add a customized header and/or footer to all the pages when you print a diagram. For example, you might want to print the Model Name, Subject Area, and Stored Display at the top of every page and the page number and date and time at the bottom of every page.

When you click the Header/Footer tab at the top of the Page Setup dialog, ERwin displays the Header/Footer section of the Page Setup dialog. Keep in mind that if you manually enter incremental information in the Header or Footer text box (for example, page number, date, etc.), ERwin cannot automatically update the text. Use the Header/Footer buttons to insert information that needs to be automatically updated.

If you want to enter or edit the Header/Footer text before you close the Print Model dialog, click Apply to save the margin settings and then click the Header/Footer tab.

The purpose of each control on the Header/Footer tab is explained below:

•	 Total Page. Click this button if you want to print the total number of page grids (for example, 2,3 = two rows and 3 columns) that comprise the printed diagram. This is useful if you print large diagrams that comprise more than one page grid. Use for header or footer.

•	 Current Page. Click this button if you want to print the current grid page number (for example, 1,2 = first row, second column) for each printed grid of the diagram. This is useful if you print large diagrams that comprise more than one page grid. Use for header or footer.

•	 Time. Click this button to print the current time (e.g., 11:21:53 AM = hour, minutes, seconds, AM or PM) in the header or footer of your printed diagram.

•	 Date. Click this button to print the current date (e.g., 6/12/97 = June 12, 1997) in the header or footer of your printed diagram.

•	 Subject Area. Click this button to print the current subject area name in the header or footer of your printed diagram. The subject area name prints just as it displays in the diagram window title bar.

•	 Stored Display. Click this button to print the current stored display in the header or footer of your printed diagram. The stored display name prints just as it displays in the diagram window title bar.

•	 File Name. Click this button to print the current file name in the header or footer of your printed diagram. The file name prints just as it appears in the diagram window title bar.

•	Header. Text box for header information. By default, ERwin inserts Diagram Name, Stored Display, and Subject Area information into the header. You can change any of the header information, and you can type meaningful information such as a custom title.

•	Footer. Text box for footer information. By default, ERwin inserts Grid Page Number, Time and Date information into the footer. You can change any of the footer information, and You can also type meaningful information such as a diagram version number.

Related Topics

  To create a page header/footer

  Printing an ERwin Diagram

  Setting the Page Margins


To create a page header/footer

1.	Click the Page Setup button in the Print Model dialog.

2.	Click the Header/Footer tab at the top of the Page Setup dialog to switch to the Header/Footer section.

3.	Click in the Header or Footer text box to specify in which area you want to insert the customized text.

4.	Click the appropriate Header/Footer button to automatically insert information (grid page numbers) and/or use the keyboard to insert other information (for example, your name).

5.	Click the OK button. ERwin saves the margin with the current stored display and returns to the Print Model dialog.

Note:	If you want to enter or edit the Margin information before you close the Print Model dialog, click Apply to save the margin settings and then click the Margin tab.


Using the Print Setup Dialog

ERwin uses a standard Windows print dialog to set up printers. You can choose the default printer and change various print options such as page orientation, paper size, paper tray, etc. in the Print Setup dialog.

The purpose of each control in the Print Setup dialog is explained below:

•	Name. Lists the printers that are set up on your computer.

•	Size. Specifies the size of the paper or envelope you want to use.

•	Source. Specifies where the paper you want to use is located in the printer. Different printer models support different paper sources, such as the upper tray, envelope feed, and manual feed.

•	Orientation. Specifies whether the document should be printed with its top along the short edge of the paper (portrait) or along the long edge of the paper (landscape).

Related Topics

  To use ERwin's printer setup options

  Printing an ERwin Diagram


To use ERwin's printer setup options

1.	Choose the Print Setup option on the File menu to display the Print Setup dialog.

2.	Accept the default printer, page orientation, paper size and source settings or select another option.

•	To select a different printer, select a printer from the printer Name list box.

•	To select a different page orientation, select either the Portrait or Landscape option button.

•	To change the paper size, select the Size list box and select a different paper size.

•	To change the paper source, select the Source list box and select a different paper source.

•	To change graphic and print quality options, click on the Options button to open the Windows Print Options dialog.

3.	Click the OK.

Note:	Changing to landscape page orientation affects both the page grid and the printer fonts. If you change the orientation for a diagram, you should adjust the objects and relationships in your diagram for the new layout.


Closing a Diagram

When you finish working on either an ERwin or ModelMart diagram, you can close the current diagram and continue working on another, or you can close the diagram and exit from ERwin.

To close a diagram, choose the Close option on the File menu. ERwin displays the Close Diagram dialog with available diagram and ModelMart options. The ModelMart options are only active if you have an active ModelMart connection.

The purpose of each control on the Close Diagram dialog is explained below:

•	Save to ModelMart. Click this button to save the diagram to the ModelMart before closing.

•	Save as ER1 File. Click this button to save the diagram as an ER1 file before closing. When you click on the OK button and the diagram has not been saved before, ERwin displays the Save As dialog so you can enter the name and path for the file.

•	Close Without Saving. Click this button to close the diagram without saving.

•	Keep ModelMart Snapshot for Later Merge. Select this check box to work remotely on a ModelMart diagram and later merge your changes back to the ModelMart. This check box is enabled when you choose the Save as ER1 file option described earlier.

•	Keep ModelMart Diagram Lock. Select this check box if you want to retain the lock on the currently active ModelMart diagram after closing.

Related Topics:

  To close an ERwin diagram

  Saving an ERwin Diagram

  To close a ModelMart diagram


To close an ERwin diagram

1.	Choose the Close option from the File menu.

2.	Choose one of the following options:

•	If closing an ERwin diagram, select the Save as .er1 File button on the Close Diagram dialog. If the diagram has never been saved before, ERwin displays the Save As dialog. If the diagram has been saved in a previous session, ERwin closes the diagram and saves the current changes.

•	If closing an ERwin diagram without saving changes, select the Close without saving option button.

•	If closing a ModelMart diagram, select the appropriate save options. More>>

3.	Click OK.


Using On-Diagram Editing

As you design a data model, the names of objects such as entities, tables, views, attributes, columns, relationships, and text blocks may frequently change. New objects may be added or deleted. Instead of opening an editor each time you want to change an object’s name or add or delete an object, ERwin lets you edit objects directly in the Diagram window.

To change an object’s name in the Diagram window, simply click on the Pointer tool or the Attribute Manipulation tool, select the object that you want to change, and then click on the selected object again (do not double-click as you normally would to open the object’s editor). ERwin displays the name of the selected object in an outlined edit box. You can edit or erase all or part of the old name, and then type the new name in the edit box.

When you finish editing an object’s name, press SHIFT-ENTER to save your changes. ERwin immediately changes the object’s name and applies the change throughout the diagram just as it does when you change an object’s name in an editor.

You can also delete an attribute using the On-Diagram editing method. To delete an attribute, erase its name in the edit box and click SHIFT-ENTER.

When you edit an entity or attribute name, ERwin lets you immediately change other objects in the same entity. For example, if you change the name of the entity, you also might want to change the name of one or more attributes in the same entity. To continue editing the next object in an entity, use the TAB key or the down arrow key (↓). See Summary of On Diagram Editing for more information.

Note:	You cannot delete a foreign key attribute using On-Diagram editing. If you change the name of a foreign key using On-Diagram editing, ERwin treats the new name as a rolename.


To change an object's name in the diagram window

1.	Select the appropriate tool from the Toolbox (i.e., use the Attribute Manipulation tool for attributes and the Pointer tool for all other objects).

2.	Click to select the object that you want to change, wait briefly, then click again. ERwin draws an edit box around the object’s name.

3.	Click in the edit box. Edit or erase some or all of the old name and type the new name.

4.	Press SHIFT-ENTER to save your changes or press the TAB key to go to the next related object (e.g., to edit the next attribute in the entity). ERwin automatically applies the changes you enter throughout the diagram. For example, if you change the name of a primary key, the name of the migrated foreign key also changes.


Using ERwin with PowerBuilder

ERwin works seamlessly with PowerBuilder from Powersoft Corporation. Using ERwin and PowerBuilder, you can manage both client-oriented information like PowerBuilder extended attributes and server-oriented information like triggers, stored procedures, and physical storage objects from within ERwin. ERwin supports a two-way link to the PowerBuilder dictionary. You can import, view, and modify an application's client-oriented attribute values in the same environment where you model the server-oriented database schema.

In addition, ERwin can significantly increase your productivity through its model-driven application development features, including the ability to automatically generate PowerBuilder DataWindows for every entity in your data model. Using the ERwin DataWindow Wizard, you can quickly create fully functional DataWindows that can be used to develop application forms and reports in the PowerBuilder development environment.

Together, ERwin and PowerBuilder form a complete database design environment for client-server development. You can use the best tools for each part of the development process:

•	PowerBuilder for building sophisticated GUI client applications and for managing the connection between application objects and data sources.

•	ERwin for developing the logical data model, including relationship descriptions, rolenames, foreign key migration, referential integrity rules, and other database design and maintenance functions, along with forward and reverse engineering (FRE), and a direct link to the database catalog.

You can forward engineer your physical database directly from your ERwin data model and then use PowerBuilder to build your application on top of the normalized data structure. Or, when a database already exists, you can reverse engineer it into an ERwin diagram, and then use the ERwin toolset to re-engineer and/or migrate the database schema to a different target database.

Related Topics:

  Defining PB Client Information


Defining PB Client Information

In ERwin you can define PowerBuilder extended attributes and assign them to a column to control how the data stored in a column is displayed in a client application. You assign client-side extended attributes to a column in the same way that you assign server-side properties, like the datatype, to a column.

This topic links to topics that explain how to create and modify PowerBuilder extended attributes from the ERwin data modeling environment. Many of the dialogs ERwin provides for defining PowerBuilder extended attributes are simply extended versions of the ERwin editors that are used to define server-side column properties.

For more information on defining server-side column properties and using the associated ERwin editors, see Using the Column Editor for more information.

Note:	When you create, modify, or assign extended attributes to columns in ERwin, you must synchronize these changes with the target database and with PowerBuilder. See Synchronizing ERwin and PowerBuilder for more information.

Related Topics:

  Selecting a Target Client

  ERwin PB Client Menu

  Assigning PB Extended Attributes to Database Columns

  Creating and Modifying PB Extended Attributes

  Assigning PB Extended Attributes to a Domain

  Migrating PB Extended Attributes

  Resetting PB Extended Attributes to Domain Defaults

  Globally Resetting PB Extended Attributes to Domain Defaults

  Rebinding PB Extended Attributes

  Assigning PB Extended Attributes to Database Tables or Views


Selecting a Target Client

When you choose Target Client from the Client menu, you can select PowerBuilder or Visual Basic as the client development platform. If you select PowerBuilder, you can use the Version list to select the version of PowerBuilder you work with and you can select the PowerBuilder library (PBL file) in which DataWindows generated by ERwin are stored.

The purpose of each control in the Target Client dialog is explained below:

•	PowerBuilder. Click the button to select PowerBuilder as the target client.

•	Visual Basic. Click this button to select Visual Basic as the target client.

•	None. Click this button to select no target client. When you select None, neither Power Builder nor Visual Basic tabs will appear on ERwin editors and references to Power Builder or Visual Basic will not be generated in your SQL script.

•	Version. Select the version of PowerBuilder that you are working with. This list is only enabled when PowerBuilder is the selected target client.

•	Reset. Click this button to globally reset PB extended attributes such as PB edit styles and display formats. See Globally Resetting PB Extended Attributes to Domain Defaults for more information.

•	Rebind. Click this button to globally rebind column properties in ERwin (entity definitions, attribute names, and attribute definitions) with the corresponding PB extended (table comments, column headings, and column comments). See Rebinding PB Extended Attributes for more information. This control is only enabled when PowerBuilder is the selected target client.

•	PB Catalog Owner. Type the owner name of the PB catalog tables in the text box. This control is only enabled when PowerBuilder is the selected target client.

•	PBL File. Use this edit box at the bottom of the Target Client dialog to choose the PowerBuilder library (PBL) file in which to store the DataWindows you create in ERwin. See Selecting a PowerBuilder Library for ERwin-Generated DataWindows for more information. This control is only enabled when PowerBuilder is the selected target client.

•	Browse. Click this button to select the drive, directory, and filename of the target PowerBuilder library (PBL) file. This control is only enabled when PowerBuilder is the selected target client.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	During a single ERwin session, you can generate DataWindows to only one PBL file. To generate DataWindows to another PBL file, you must close and restart ERwin, then choose the new PBL file in the Target Client dialog.

Related Topics

  To select a target client


To select a target client

1.	Choose Target Client from the Client menu.

2.	Click on one of the following buttons:

•	PowerBuilder. Click this button if you want the target client to be PowerBuilder.

•	Visual Basic. Click this button if you want the target client to be Visual Basic.

•	None. Click this button if you do not want a target client.

3.	If you select PowerBuilder in Step 2, you can also choose the following options:

•	Version. Select the version of PowerBuilder you are using.

•	PB Catalog Owner. Type the name of the PowerBuilder catalog owner.

•	PBL File. Enter the pathname and filename of the PowerBuilder library (PBL file) in which you want to store ERwin-generated DataWindows. You can also use the Browser button to select the disk, directory, and filename of the PBL file.

4.	Click OK.


ERwin PB Client Menu

Using the ERwin PB client menu, you can define PB extended attributes in your ERwin physical model. When PowerBuilder is the selected target client, the purpose of each item on the Client menu is explained below:

•	PB Edit Styles. Select this menu item to define physical column edit styles. See Using the PB Edit Style Editor for more information.

•	PB Display Format. Select this menu item to define physical column display formats. See Using the PB Display Format Editor for more information.

•	Validation Rule. Select this menu item to define physical column validation rules. See Defining PB Validation Rules for more information.

•	Valid Value. Select this menu item to define physical column valid values. See Defining PB Valid Values for more information.

•	Default/Initial. Select this menu item to define physical column default and initial values. See Defining PB Initial Values for more information.

•	Target Client. Select this menu item to choose PowerBuilder as your target client development platform. You can also choose a PowerBuilder library for ERwin-generated DataWindows, and globally reset or rebind PB extended attributes values. See Selecting a PowerBuilder Library for ERwin Generated DataWindows , Globally Resetting PB Extended Attributes to Domain Defaults, and Rebinding PB Extended Attributes for more information.

•	Create DW. Select this menu item to create PowerBuilder DataWindows. See Using the ERwin DataWindow Wizard for more information.

•	PB Sync Option. Select this menu item to set the options for synchronizing your ERwin data model with the PowerBuilder dictionary. See Setting PB Synchronization Options for more information.

•	Sync ERwin with PB. Select this menu item to synchronize your ERwin data model with the PowerBuilder dictionary. See Running the PB Synchronization Process for more information.


Assigning PB Extended Attributes to Database Columns

You can use the Column Editor or the View Column Editor to assign PB extended attributes to a database column in the same way that you assign server-side column properties, such as column name and datatype to a database column. You can associate PowerBuilder elements, such as user interface controls and display format instructions, with each column. And, just as you combine column properties into ERwin domains to streamline the database design process, you can incorporate extended attributes into domains to speed the client application development process. See Assigning PB Extended Attributes to a Domain for more information.

In the Column Editor and the View Column Editor, the controls for assigning PB extended attributes to a database column are on PowerBuilder tabs.

The purpose of each control on the first PowerBuilder tab is explained below:

•	Format. Select to apply a display format to the selected column.

•	 (Format). Click this button to open the PB Display Format Editor. See Using the PB Display Format Editor for more information.

•	Style. Select to apply an edit style to the selected column.

•	 (Style). Click this button to open the PB Edit Style Editor. See Using the PB Edit Style Editor for more information.

•	FK Style. Select to apply a foreign-key edit style to the selected foreign key column.

•	 (FK Style). Click this button to open the PB Edit Style Editor. See Using the PB Edit Style Editor for more information.

•	Valid. Select to apply a validation rule to the selected column.

•	 (Valid). Click this button to open the Validation Rule Editor. See Defining PB Validation Rules for more information.

•	Initial. Select to apply an initial value to the selected column.

•	 (Initial). Click this button to open the <Database> Default/Initial Value Editor. See Defining PB Initial Values for more information.

♦	Justify. Select the text justification option from the displayed list. The supported options are: left, right, or center.

♦	Case. Select the text case option from the list displayed. The supported options are: Any, UPPER, or lower.

♦	Height. Enter a value (less than 25) to specify the height of the control used to display the selected column’s data.

♦	Width. Enter a value (less than 25) to specify the width of the control used to display the selected column’s data.

Note:	If you enter a value greater than 25 in the Height or Width boxes, PowerBuilder generates an error.

The purpose of each control on the second PowerBuilder tab is explained below:

•	Label. Use this text box to enter the text string that identifies the column in a freeform DataWindow.

•	Pos. Use this list to define the position of the label text.

•	Header. Use this text box to specify the column title in tabular-grid DataWindows. By default, ERwin assigns the %AttName trigger template macro to both the Label and the Header. When the physical schema is generated, ERwin inserts the corresponding attribute’s logical name.

•	Pos. Use this list to define the position of the header text.

•	Bitmap. Select this check box if you want to display the bitmap in the client application window.

•	Comment. Use this text box to specify a comment for the selected column. ERwin assigns %AttDef as a default initial value to this control, which is replaced by the attribute definition during schema generation. If you want to override the default value, you can type in a new comment.

Note:	The Reset button in the Column Editor and View Column Editor lets you define which PowerBuilder extended attributes you want to reset to the values defined in the default domain. See Resetting PB Extended Attributes to Domain Defaults for more information.

The Migrate button in the Column Editor lets you define which PowerBuilder extended attributes that migrate across relationships in the same way that you specify which server-side column properties migrate across relationships. When you select this button, ERwin displays the PowerBuilder Migrate Options dialog. See Migrating PB Extended Attributes for more information.

Related Topics:

  To assign PB extended attributes to a database column

  Creating and Modifying PB Extended Attributes

  Using the Column Editor

  Using the View Column Editor


To assign PB extended attributes to a database column

1.	Right-click on a table, choose Column Editor from the shortcut menu to open the Column Editor.

OR

Right-click on a view, choose View Column Editor from the shortcut menu to open the View Column Editor.

2.	Select the column to which you want to assign PB extended attributes in the Column list.

3.	Use the spin control to scroll to the PowerBuilder tabs.

4.	Click on either of the PowerBuilder tabs.

5.	Assign the extended attributes you want in either tab.

6.	Click OK.


Creating and Modifying PB Extended Attributes

In ERwin, there are five editors for creating and modifying PB extended attributes:

•	Edit Style Editor

•	PB Display Format Editor

•	Validation Rule Editor

•	Valid Values Editor

•	Default/Initial Value Editor

The ERwin Edit Style Editor and Display Format Editor are very similar to the corresponding dialogs in PowerBuilder. These editors are reproduced in ERwin for convenience, so you can view or modify PB extended attributes and column properties in one unified environment.

The Validation Editor, Valid Values Editor, and Default/Initial Value Editor let you define validation rules, valid values, and default values for both the target server and PowerBuilder. If you have used any of these editors to define server-side column properties, you’ll find the process of defining PowerBuilder extended attributes very familiar.

You can also use the Domain Dictionary Editor to assign both client-side extended attributes and server-side column property values to a named domain. See Assigning PB Extended Attributes to a Domain for more information.

Related Topics:

  To open any of the PB extended attribute editors

  Using the Domain Dictionary Editor


To open any of the PB extended attribute editors

•	Choose the appropriate option from the Client menu.

OR

Right-click on a table, choose Column Editor from the shortcut menu to open the Column Editor dialog, then click on the PowerBuilder tab.

OR

Right-click on a view, choose View Column Editor from the shortcut menu to open the View Column Editor dialog, then click on the PowerBuilder tab.

Note:	You can click on the [image] button next to an extended attribute (Format, Style, FK Style, Valid, or Initial) to open the corresponding editor.


Using the PB Edit Style Editor

By using the PB Edit Style Editor, you can create and modify PowerBuilder edit styles that control how you view, enter, and edit information in a PowerBuilder application. When you assign an edit style to a database column, you associate the database column with a specific type of PowerBuilder control. You can create or change a PowerBuilder edit style by choosing PB Edit Styles from the Client menu to open the Edit Style Editor.

The PowerBuilder edit styles you can create in ERwin are show in the following table.

Edit Style	Description
	Edit. ERwin assigns a single line Edit box as the default edit style if you do not assign a style type to an edit style.
	Edit mask. A presentation format specified by a set of symbols that indicates how the data in the column should be displayed in the client application, such @@@-@@-@@@@ for social security numbers or (@@@)-@@@-@@@@ for telephone numbers.
	Check Box. This style lets you select or clear a displayed choice by clicking in the box graphic.
	Radio button. This style lets you choose one item from a short list by clicking in the circular graphic.
	Drop-down list. This style lets you browse and choose one item from a longer list.
	Drop-down DataWindow. This style lets you browse and choose an entry value from a database lookup table. The control looks like the Drop-down list shown above, except that it can display more than one column from the specified lookup table.
Each edit style has additional options to control the display and entry of data. The ERwin dialog controls in each case function exactly like those in the corresponding PowerBuilder Edit Style dialog. See the PowerBuilder documentation for more information.

The purpose of each control in the PB Edit Styles dialog is explained below:

•	Edit Style Name and Edit Style Type. Lists the name of each edit style in the active ERwin diagram and the corresponding edit style type.

•	Edit Style Type. Identifies the type of the currently selected edit style name. Click on the button next to the edit style you want to apply a new edit style type to the currently selected edit style name. The controls displayed in the PB Edit Styles dialog vary depending on which edit style type is selected.

•	New. Click to create a new edit style.

•	Rename. Click to rename the currently selected edit style.

•	Delete. Click to delete the currently selected edit style.

•	PB Sync. Click to synchronize the edit styles in your ERwin diagram with the edit styles in the PowerBuilder dictionary. Only edit styles are synchronized. See Synchronizing ERwin with the PowerBuilder Dictionary for more information.

•	Close. Click to close the PB Edit Styles dialog.

Note:	Any entry or change you make in the Edit Style Editor is temporarily saved in memory when you switch the focus to another Edit Style. Changes are permanently saved to disk when you save the diagram.

Related Topics:

  Primary and Foreign Key Edit Styles

  To create a PB edit style

  To modify a PB edit style


Primary and Foreign Key Edit Styles

A column that is part of the primary or foreign key in a table can be assigned two edit styles: a Primary Edit Style to display data from the table in which it is a primary key and a second style, called the FK Edit Style, to display data from a table in which it is a foreign key. For example, in the MOVIES model, the movie number column can be assigned one edit style (such as an edit box) to display the data it stores in the MOVIE table and a different edit style (such as a drop-down list) to display the data it stores in the MOVIE-COPY table.

Related Topics:

  To create a PB edit style

  To modify a PB edit style

  Using the PB Edit Style Editor


To create a PB edit style

1.	Choose PB Edit Styles from the Client menu to open the Edit Style Editor.

2.	Click the New button.

3.	Type the name of the new edit style in the New Edit Style dialog, select the type of edit style, and click OK.

4.	Choose the validation rule that defines the valid value list from the Validation drop-down list and then choose the edit style you want to apply to the valid value choices. The edit styles that can be associated with a validation rule include:

•	Edit Mask with the Spin Control option selected

•	Radio Button

•	Edit with the Use Code Table option selected

•	Drop Down LB

•	Checkbox

5.	To synchronize the edit styles in your ERwin diagram with the edit styles in the PowerBuilder dictionary, click the PB Sync button.

6.	Click the Close button.


To modify a PB edit style

1.	Choose PB Edit Styles from the Client menu to open the Edit Style Editor.

2.	Select an existing edit style from the list at the top editor.

•	To simply rename the selected edit style, click the Rename button, type the new name in the Rename Edit Style text box, and click OK.

•	To change the type of the selected edit style, click the appropriate radio button in the Edit Style Type group box on the left side of the editor and select the values for the newly selected edit style type.

3.	To synchronize the edit styles in your ERwin diagram with the edit styles in the PowerBuilder dictionary, click the PB Sync button.

4.	Click the Close button.


Using the PB Display Format Editor

Using the PB Display Format Editor, you can create and modify PowerBuilder display formats that allow column information to be presented in a manner different from the way it is stored. Display formats are frequently used to show numbers as currency values or to show date values in a specific month-day-year format. A display format can be applied to any database column that is assigned an Edit Mask edit style - it essentially tells PowerBuilder how to display the data when the cursor leaves the field in your application.

A display format is specified by a string of symbols such as MM dd yy, that indicates how the data in the column should be displayed in the client application. See the PowerBuilder documentation for more information.

The purpose of each control in the Display Format Editor is described below:

•	Format Name. This list displays the currently existing display formats. You can select any listed display format to rename, delete, or make format changes.

•	PowerBuilder Display Format. Use this text box to type a new display format mask, or to change an existing selected display format. You can use the same syntax (including special characters and keywords) as in the PowerBuilder Display Format Definition dialog. Refer to your PowerBuilder documentation for more information.

•	Type. Choose a PowerBuilder format type (string, number, date, time or datetime) from the drop-down list.

•	New. Click this button to create a new PowerBuilder display format. Type a name in the New Format dialog and click OK.

•	Rename. To change the name of an existing display format, select the display format you want to modify from the list. Then type a new name in the Rename Format text box and click OK.

•	PB Sync. Click to synchronize the display formats in the ERwin model with the PowerBuilder dictionary. Only display formats are synchronized. See Synchronizing ERwin with the PowerBuilder Dictionary for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	Any change you make in the PB Display Format Editor is temporarily saved in memory when you click OK or switch the focus to another display format. Changes are permanently saved to disk only when you save the diagram.

Related Topics:

  To create a PB display format

  To modify a PB display format


To create a PB display format

1.	Choose PB Display Format from the Client menu to open the PB Display Format Editor.

2.	Click the New button and type the name of the new display format the Name text box.

3.	Click OK. The new display format name displays in the Format Name list.

4.	Type a new display format string in the PowerBuilder Display Format text box.

5.	Select a PowerBuilder format type (string, number, date, time or datetime) from the Type drop-down list.

6.	To synchronize the display formats in the ERwin diagram with the PowerBuilder dictionary, click the PB Sync button. More>

7.	Click OK.


To modify a PB display format

1.	Choose PB Display Format from the Client menu to open the PB Display Format Editor.

2.	Select the display format you want to change from the list at the top of the PB Display Format Editor, then choose one or more of the following options:

•	To rename the selected display format, click the Rename button and type the new name in the Name text box. Then click OK.

•	To change the format mask of an existing display format or create a new format mask, type the appropriate string in the PowerBuilder Display Format text box.

•	To change the type of the selected display format, choose a PowerBuilder format type (string, number, date, time or datetime) from the Type drop-down list.

3.	To synchronize the display formats in the ERwin diagram with the PowerBuilder dictionary, click the PB Sync button. More>

4.	Click OK.


Defining PB Validation Rules

The Validation Rule Editor lets you specify validation rules, which are enforced by the server and restrict what values can be stored in a column. You can also use the Validation Rule Editor to create a similar type of validation rule that restricts what values can be entered in the corresponding data entry control in a PowerBuilder client application. Creating a validation rule provides instant feedback if a user enters invalid data in the corresponding data-entry control.

The Validation Rule Editor accessed from the Client menu is identical to the Validation Rule Editor accessed from the Server menu. When you choose Validation Rule from the Client menu, the PowerBuilder controls are displayed by default. You can also click on the server tab for server-related options.

The purpose of each control on the PowerBuilder tab is explained below:

•	Validation Name. Displays all the existing validation rules in the ERwin data model.

•	Validation Type. Indicates whether the rule is enforced by the client, the server, both, or neither (a validation rule might be used by an edit style just for its valid values). A server-side rule is used to generate a table or column constraint. A client-side rule generates a PowerBuilder validation rule.

•	Sort By Type. Select this checkbox if you want to alphabetically sort the validation rules by type. When selected, all PB validation rules are displayed before any server-side validation rules. By default, the check box is cleared and the validation rules are not sorted.

•	Copy. Select this check box if you want to assign the valid value list associated with an existing validation rule to a new validation rule. To assign a valid value list, select the validation rule that you want to use as a source and select the Copy check box. Then, create a new validation rule. ERwin copies the valid values from the source to the new validation rule and creates the appropriate default server expression for the valid values you assigned. See Valid Value below for more information.

•	Client Expression - PowerBuilder Validation Rule. This text box works like the <DB Validation Rule> control on the <Database> tab. To activate this box, ensure the Client box in the Validation Type group box is selected. Use the Client Expression control to enter a valid PowerBuilder expression for your client validation rule. For example, if you want PowerBuilder to check that the value entered in the due_date field is greater than the date entered in the rental_date field, you would enter the expression @due_date > rental_date in the Client Expression text box.

•	Min. / Max. If you want ERwin to automatically generate a validation rule that specifies a minimum value, a maximum value, or a range of values, type the appropriate values in the Min or Max or both text boxes, then click in the Client Expression - PowerBuilder Validation Rule text box. ERwin generates the corresponding validation rule in PowerBuilder syntax.

•	Valid Value. You can also enter a list of valid values which a PowerBuilder application can display as a group of radio buttons, a drop-down list, etc., depending on the edit style assigned to the column. For example, to display a list of movie categories as a set of radio buttons, click the Valid Values button to open the Valid Values Editor. Enter the list of valid values for the movie categories, and then click OK to return to the Validation Rule Editor.

•	<--Set Expr. Click this button to generate the validation rule from the valid values list and click OK. You can then create a radio button style in the Edit Style Editor and assign the edit style and validation rule to a column to display the valid values as a set of radio buttons. See Using the PB Edit Style Editor for more information.

•	PB Error Msg. Use this text box, if you want to enter a warning message that PowerBuilder should display if a user enters data that fails the client validation rule. Choose a datatype from the PB Type list to specify the PowerBuilder datatype to which the rule applies.

•	PB Sync. Click this button if you want to synchronize any differences between ERwin and PowerBuilder validation rules. Only validation rules are synchronized. See Synchronizing ERwin with the PowerBuilder Dictionary for more information.

•	Quote. Select this check box to toggle the quotes on or off in the Client Expression - PowerBuilder Validation Rule text box. For example a '10' would become a 10 and vice-versa.

•	NOT. To invert the PowerBuilder expression, check the NOT box. ERwin automatically inverts the expression. For example, if the PowerBuilder expression is @col >= 1 AND @col <= 10, and you check the NOT box, ERwin changes the expression to @col < 1 OR @col > 10.

•	New. Click to open the New Validation dialog. Type a new validation rule name, and click OK.

•	Rename. Click this button to open the Rename dialog. Change the name of the selected validation rule, and click OK.

•	Delete. Click to delete the selected validation name.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	Any change you make in the Validation Rule Editor is temporarily saved in memory when you click OK or switch the focus to another validation rule. Changes are permanently saved to disk when you save the diagram.

Related Topics

  To create or modify a PB validation rule

  Using the Validation Rule Editor


To create or modify a PB validation rule

1.	Choose Validation Rule from the Client menu or the Server menu to open the Validation Rule Editor. The list at the top of the editor displays all the existing validation rules in the ERwin diagram.

•	To modify an existing validation rule, select the validation rule you want to modify in the list. To simply rename the selected validation rule, click the Rename button, type the new name in the Name text box and click OK.

•	To create a new validation rule, click the New button, type the name of the new validation rule in the Name text box and click OK.

•	If you want to use the valid values from an existing rule in a new validation rule, select the Copy check box and select the existing rule from the list. Then, click the New button, type the name of the new validation rule in the Name text box and click OK.

2.	Select the Client check box in the Validation Type group box.

3.	Choose one of the following options:

•	To enter a client expression, type or edit a PowerBuilder validation rule in the Client Expression - PowerBuilder Validation Rule box.

•	To create a list of valid values (or to modify the list), click the Valid Value button. In the Valid Value Editor, enter the values, then click OK to return to the Validation Rule Editor.

4.	Click the <--Set Expr button to generate the PowerBuilder rule.

5.	Choose the PowerBuilder datatype (string, number, date, time or datetime) from the PB Type list.

6.	If you want, you can enter a PowerBuilder error message by typing the message expression in the PB Error Msg text box.

7.	To synchronize the validation rules in the ERwin diagram with the PowerBuilder dictionary, click the PB Sync button. Only validation rules are synchronized.More>

8.	Click OK.


Defining PB Valid Values

Using the Valid Value Editor, you can create a fixed list of all acceptable values that can be stored in a column. You can then assign the list to a validation rule. The Valid Value Editor lets you assign a display value to each valid value that can be used as a label or a selectable data item by a PowerBuilder edit style. In this way, you can control how a list of valid values appears in the PowerBuilder client application: as a series of radio buttons or check boxes, a drop-down list, or a spin control.

The purpose of each control in the Valid Value Editor is explained below:

•	Valid Rule. This list displays all existing validation rules.

•	Data Value. This column displays the valid data values you create for the selected validation rule. Data values are values used in PowerBuilder expressions. See Defining PB Validation Rules for more information.

•	Display Value. Type a value that PowerBuilder displays for the selected ERwin data value. For example, if the value definition is "Recently released videos," you can assign this the display value, "New Releases". This phrase appears as a text label on the PowerBuilder DataWindow or as one of the choices in the list of valid values.

•	Insert. Select this check box to insert a new data value above the currently selected data value in the Data Value list. If not selected, ERwin places the new data value at the end of the list.

•	Value Definition. Type a definition of the selected data value. This is a free form text box that you can use for any documentation purpose.

•	New. Click to add a new valid value. Type the valid value name in the Name text box of the New Valid Value dialog, and click OK.

•	Rename. Click this button to open the Rename Validation dialog and change the name of the selected validation name.

•	Delete. Click to delete the selected validation name.

•	Sort. Click to alphabetically sort the data values in the Data Value list.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	The Valid Values menu option is only enabled if you’ve defined at least one validation rule in the data model.

Related Topics

  To create or modify PB valid values

  To assign an edit style to a PB valid values list

  Using the Valid Value Editor


To create or modify PB valid values

1.	Choose one of the following:

Choose Valid Values from the Client menu.

OR

Click the Valid Values button in the Validation Rule Editor.

2.	Select a validation rule from the Valid Rule list.

3.	Click the New button, type a new valid value name in the New Validation dialog, and click OK.

4.	To apply a display value to the data value, complete the Display Value text box and click the New button.

5.	Complete the Value Definition text box for each valid value item.

6.	To change any component of a valid value, click on the data value in the list and click the Rename button. Type the new name in the Rename Validation dialog, and click OK.

7.	Click OK.

Note:	The Valid Values menu option is only enabled if you’ve defined at least one validation rule in the data model.


To assign an edit style to a PB valid values list

1.	Choose PB Edit Styles from the Client menu.

2.	Click the New button, type a name for the edit style in the New Edit Style text box and click OK.

3.	Choose one of the following edit style types in the Edit Style Type group box:

•	Edit Mask

•	Radio Button

•	Edit

•	Drop Down LB

•	Checkbox

4.	Click on the Validation list and select the validation rule that defines the valid value list.

•	If you are using the Edit Mask control, you must select the Spin Control option to select the validation rule.

•	If you using the Edit control, you must select the Use Code Table option to select the validation rule.

5.	Choose any additional options available for the selected edit style type.

6.	Click the Close button.


Defining PB Initial Values

You can use the <Database> Default/Initial Editor to create a default value that is assigned to a column automatically. Frequently, the most common value stored in a column is assigned as the default value for that column. You can also use the <Database> Default/Initial Editor to specify a separate initial value for your PowerBuilder client application.

By defining a separate PowerBuilder initial value, you can insert a default value in the client application that may be different from the default value stored in the column. For example, the default value assigned to the general_condition column might be "New" in the client application and "null" on the server. Or the client-side default value might be derived from the data input for a particular transaction, such as calculating a discount if a customer rents more than one movie or the current date is a weekday.

You can set PowerBuilder client defaults by using the PowerBuilder-related controls in the ERwin Default Editor. See Using the <Database> Default/Initial Value Editor for more information.

The purpose of each control in the Default/Initial Value Editor are described below:

•	Default Name. This box at the top of the dialog displays all the existing defaults in the ERwin data model. The left column displays the default names. The right column displays the default type based on whether the default expression is entered in the Server Value and/or Client Value text boxes.

•	Sort By Type. Select this check box if you want to sort the default names by type. If selected, the default names are sorted alphabetically by type so that all client-side defaults are displayed before any server-side defaults.

•	Client Value. Use this text box to type a PowerBuilder initial value or expression for the default. See your PowerBuilder documentation for information on the expression syntax.

•	New. Click to add a default name. Type the default name in the New Default dialog, and click OK.

•	Rename. Click this button to open the Rename Default dialog and change the name of the selected validation name.

•	Delete. Click to delete the selected default name.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To create or modify a PB initial value


To create or modify a PB initial value

1.	Choose Default/Initial from the Client menu to open the Default/Initial Editor.

2.	Choose one of the following options:

•	To create a new default, click the New button, type the name of the new default in the Name text box of the New Default dialog, and click OK.

•	To modify an existing default, select the default you want to modify in the list. To simply rename the selected default, click the Rename button, type the new name in the Name text box of the Rename Default dialog, then click OK.

3.	Type or edit the PowerBuilder initial default value or expression in the Client Value text box.

4.	Click OK.


Assigning PB Extended Attributes to a Domain

By creating an ERwin domain, you can save a set of column properties together under a common name. For example, a domain can include several server-side column properties, such as a datatype, null option, default, and validation rule.

You can also create an ERwin domain that includes PB extended attributes to make user-interface development easier and faster. For example, you can create a domain named "DATE" that sets the display format, edit style, and initial value for all date values in a client application. You can then assign this domain to all date columns. If necessary, you can use the Column Editor to override one or more of the extended attributes assigned to a column by the DATE domain.

To create or edit a PowerBuilder domain, choose Domain from the Edit menu. The Domain Dictionary Editor works like the Column Editor,except that you can view and modify the properties assigned to a domain instead of a physical column. Click the appropriate PowerBuilder tab to view or modify PowerBuilder extended attributes. You can also click the <Database> tab at the top of the dialog to view or modify server-side column properties.

The controls for domain inheritance and definition work exactly like their counterparts in the Domain Dictionary Editor. See Using the Domain Dictionary Editor for more information.

Related Topics

  To assign PB extended attributes to a domain

  Creating and Modifying PB Extended Attributes


To assign PB extended attributes to a domain

1.	Choose Domain from the Edit menu.

OR

Right-click on a table and choose Column Editor from the shortcut menu, then select the [image] button from the General tab.

2.	Click the appropriate PowerBuilder tab at the top of the Domain Dictionary Editor to display the PB extended attributes assigned to the selected domain. If needed, you can create or modify any domain by using the Domain Dictionary Editor. More>

3.	Choose the PB extended attributes you want to assign to the domain. More>

4.	If you want to reset all the PB extended attributes to the settings originally defined for the default domain, click the Reset button. More>

5.	Click OK.


Resetting or Migrating PB Extended Attributes

Resetting PB Extended Attributes:

In the PowerBuilder tab of the Reset Column Property dialog, you can reset column properties and PB extended attributes. See Resetting PB Extended Attributes to Domain Defaults for more information.

To open the Reset Column Property dialog, click the Reset button on the Column Editor, the Domain Dictionary Editor, or the Reset Names button on the Target Server dialog.

Migrating PB Extended Attributes:

In the PowerBuilder tab of the Migrate Column Property dialog, you can specify which server-side column property values migrate from a primary key column to foreign key columns. See Migrating PB Extended Attributes for more information.

To open the Migrate Column Property dialog, click the Migrate button on the Column Editor.

Related Topics

  To migrate PB extended attributes to foreign key columns

  To reset PB extended attributes to domain defaults

  Resetting Column Properties to the Domain Defaults


Migrating PB Extended Attributes

In the same way that you can specify which server-side column property values migrate from a primary key column to foreign key columns, you can also choose which PB extended attribute values migrate from a primary key column to foreign key columns. You can click the Migrate button in the Column Editor to open the Migrate Column Properties dialog and choose which PB extended attributes you want to migrate.

The purpose of each control in the PowerBuilder tab of the Migrate Column Properties dialog is explained below:

•	Format. Select this option if you want to migrate the column format to the foreign key.

•	Edit Style. Select this option if you want to migrate the column edit style format to the foreign key.

•	Valid Rule. Select this option if you want to migrate the validation rule format to the foreign key.

•	Initial Value. Select this option if you want to migrate the column initial value format to the foreign key.

•	Justify. Select this option if you want to migrate column text justification format to the foreign key.

•	Case. Select this option if you want to migrate column text case format to the foreign key.

•	Height. Select this option to migrate the control height format to the foreign key.

•	Width. Select this option to migrate the control width format to the foreign key.

•	Bitmap. Select this option to migrate the assigned bitmap format to the foreign key.

•	Comment. Select this option to migrate the control comment format to the foreign key.

•	Label. Select this option to migrate the control label format to the foreign key.

•	Pos. Select this option to migrate the control position format to the foreign key.

•	Header. Select this option to migrate the control header format to the foreign key.

•	Pos. Select this option to migrate the control position format to the foreign key.

Related Topics

  To migrate PB extended attributes to foreign key columns


To migrate PB extended attributes to foreign key columns

1.	Right-click on a table and choose Column Editor from the shortcut menu.

2.	Select the primary key column in the Column list.

3.	Click the Migrate button.

4.	Click the PowerBuilder tab to display a list of the PB extended attributes that you can migrate to foreign key columns.

5.	Select one or more of the PB extended attribute check boxes to indicate which attributes you want to migrate from the selected primary key column to the related foreign key columns in child tables. Use the Select All or Clear All button to select or deselect all of the PB extended attributes collectively.

6.	Click OK.

Note:	PB extended attribute migration is a one-way process. PB extended attributes are migrated from the primary key in the parent table to foreign key columns in child tables. Migration is never done from the child table to the parent.


Resetting PB Extended Attributes to Domain Defaults

If you have attached a domain to a column, or changed any PB extended attributes in the Column Editor to override specific domain settings, you can easily reset the PB extended attributes to the defaults provided by the domain. ERwin provides a high level of precision when resetting PB extended attributes -- you can reset only a single PB extended attribute, a group of PB extended attributes, or all the PB extended attributes for the selected column or table.

To open the Reset Column Property dialog, click the Reset button on the Column Editor, the Domain Dictionary Editor, or the Reset Names button on the Target Server dialog. You can reset the PB extended attributes of the selected column or all columns in the current table or view by clicking on the appropriate option in the Remove overridden properties for group box. Then, click on the PowerBuilder tab and select the appropriate check boxes in the dialog to indicate the PB extended attributes to be reset. For example, if you want to reset the edit style, select the Edit Style check box. You can click the Select All or Clear All button to select or clear all of the extended attributes collectively.

The purpose of each control in the PowerBuilder tab of the Reset Column Properties dialog is explained below:

•	Format. Select this option if you want to reset the column format to the value defined by the default domain.

•	Edit Style. Select this option if you want to reset the column edit style format to the value defined by the default domain.

•	Valid Rule. Select this option if you want to reset the validation rule format to the value defined by the default domain.

•	Initial Value. Select this option if you want to reset the column initial value format to the value defined by the default domain.

•	Justify. Select this option if you want to reset column text justification format to the value defined by the default domain.

•	Case. Select this option if you want to reset column text case format to the value defined by the default domain.

•	Height. Select this option to reset the control height format to the value defined by the default domain.

•	Width. Select this option to reset the control width format to the value defined by the default domain.

•	Bitmap. Select this option to reset the assigned bitmap format to the value defined by the default domain.

•	Comment. Select this option to reset the control comment format to the value defined by the default domain.

•	Label. Select this option to reset the control label format to the value defined by the default domain.

•	Pos. Select this option to reset the control position format to the value defined by the default domain.

•	Header. Select this option to reset the control header format to the value defined by the default domain.

•	Pos. Select this option to reset the control position format to the value defined by the default domain.

Related Topics

  To reset PB extended attributes to domain defaults

  Resetting Column Properties to the Domain Defaults


To reset PB extended attributes to domain defaults

1.	Right-click on a table and choose Column Editor from the shortcut menu.

OR

Right-click on a view and choose View Column Editor from the shortcut menu.

2.	Click the Reset button to open the Reset Column Property dialog.

3.	Click the PowerBuilder tab to display a list of the PB extended attributes that you can reset.

4.	Choose one of the following option:

•	Click the Only column <column_name> button to reset the checked PB extended attributes only for the selected column.

•	Click the All columns of table <table_name> button to reset the checked PB extended attributes for all the columns in the specified table or view.

5.	Select one or more of the check boxes to indicate which PB extended attributes you want to reset to domain defaults. Use the Select All or Clear All button to select or deselect all of the PB extended attributes collectively.

6.	Click OK.


Globally Resetting PB Extended Attributes to Domain Defaults

Each database column you create is automatically assigned a set of default PB extended attributes and server-side column properties by the default ERwin domain. If you override the PB extended attribute values for one or more columns, at any time, you can globally reset all PB extended attribute values to the original values specified by the ERwin domain. In the Target Client dialog, you can click the Reset button to open the Globally Reset PowerBuilder Values dialog which provides the options for resetting the PB extended attribute values.

The purpose of each control in the Globally Reset PowerBuilder Values dialog is explained below:

•	Format. Select this option if you want to reset the column format to the value defined by the default domain.

•	Edit Style. Select this option if you want to reset the column edit style format to the value defined by the default domain.

•	Valid Rule. Select this option if you want to reset the validation rule format to the value defined by the default domain.

•	Initial Value. Select this option if you want to reset the column initial value format to the value defined by the default domain.

•	Justify. Select this option if you want to reset column text justification format to the value defined by the default domain.

•	Case. Select this option if you want to reset column text case format to the value defined by the default domain.

•	Height. Select this option to reset the control height format to the value defined by the default domain.

•	Width. Select this option to reset the control width format to the value defined by the default domain.

•	Bitmap. Select this option to reset the assigned bitmap format to the value defined by the default domain.

•	Comment. Select this option to reset the control comment format to the value defined by the default domain.

•	Label. Select this option to reset the control label format to the value defined by the default domain.

•	Pos. Select this option to reset the control position format to the value defined by the default domain.

•	Header. Select this option to reset the control header format to the value defined by the default domain.

•	Pos. Select this option to reset the control position format to the value defined by the default domain.

•	Select All. Click this button to reset all PB extended attribute values in the active diagram to those of the default domain.

•	Clear All. Click this button if you do not want to reset any of the PB extended attribute values in the active diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To globally reset PB extended attributes to domain defaults


To globally reset PB extended attributes to domain defaults

1.	Choose Target Client from the Client menu.

2.	Click the Reset button to open the Globally Reset PowerBuilder Values dialog.

3.	Select the check box next to each PB extended attributes for which you want to reset the values to that defined in the default domain. Clear the check box next to each PB extended attribute for which you do not want to reset the values to that defined in the default domain. Use the Select All or Clear All buttons to select or clear all PB extended attributes collectively.

4.	Click OK.


Rebinding PB Extended Attributes

After you synchronize ERwin with PowerBuilder, you can import PB extended attribute information into your logical data model to make model names more descriptive and consistent with the user interface. When you click the Rebind button, ERwin displays a rebind confirmation dialog.

The purpose of each control in this dialog is explained below:

•	Set Entity Definitions to PB Table Comments. Select this check box to replace all ERwin entity definitions with PowerBuilder table comments.

•	Set Attribute Logical Names to PB Headings. Select this check box to replace all ERwin attribute names with PowerBuilder column headings (with carriage returns removed).

•	Set Attribute Definitions to PB Column Comments. Select this check box to replace all ERwin attribute definitions with PowerBuilder comments.

Related Topics

  To rebind PB extended attributes


To rebind PB extended attributes

1.	Select Target Client from the Client menu to open the Target Client dialog.

2.	Click the Rebind button. ERwin displays a rebind confirmation dialog.

3.	Choose one or more of the following options:

•	Select the Set Entity Definitions to PB Table Comments check box to replace each ERwin entity definition with the corresponding PowerBuilder table comment.

•	Select the Set Attribute Logical Names to PB Headings check box to replace the logical name of each ERwin attribute with the corresponding PowerBuilder column heading.

•	Select the Set Attribute Definitions to PB Column Comments check box to replace each ERwin attribute definition with the corresponding PowerBuilder column comment.

4.	Click OK.


Deleting PB Extended Attributes

You can delete PB extended attributes from the same editor you use to create or modify the PB extended attribute. To delete an edit style, display format, PB validation rule, or PB default value, open the appropriate editor (for example, the PB Edit Style Editor), select the object to delete and click the Delete button. ERwin immediately deletes the object if it is not assigned to any column or domain.

If the PB extended attribute is assigned to a column or domain, ERwin displays a confirmation dialog, stating the object’s current assignment and asking if you want to delete it anyway. Click Yes to delete, or No to cancel the deletion.

If you delete a PB extended attribute that is currently assigned to a column or a domain, the default property setting for the property is applied to the affected column. For example, if you delete a PB edit style defined as a set of radio buttons, each column and domain that uses that edit style is automatically assigned the default edit style (a single line edit control) in place of the deleted PB edit style.

Related Topics

  To delete a PB extended attribute


To delete a PB extended attribute

1.	Open the appropriate ERwin editor (PB Edit Style Editor, PB Display Format Editor, Validation Rule Editor, or Default/Initial Value Editor).

2.	Select the PB extended attribute you want to delete in the display list at the top of the editor.

3.	Click the Delete button. If ERwin displays a confirmation dialog, answer Yes to confirm the deletion.

4.	Click OK.


Assigning PB Extended Attributes to Database Tables or Views

In the same way that you use the PowerBuilder tabs in the Column Editor or View Column Editor to assign PB extended attributes to database columns, you can use the PowerBuilder tab in the Table Editor or View Editor to assign PB extended attributes to database tables or views.

Using the PowerBuilder tab in the Table Editor or View Editor, you can set text characteristics (font and size) of column data, and specify headings and labels for the columns in a table as you want them to appear in a PowerBuilder DataWindow. In addition, you can enter an optional comment for the DataWindow, and specify the PowerBuilder library in which the DataWindow is stored.

The purpose of each control in the PowerBuilder tab of the Table Editor or View Editor is explained below:

•	Table or View. Use this list at the top of the editor to select the table or view used to generate a DataWindow.

•	Name. Use this text box if you want to rename the current table.

•	Owner. Use this text box if you want to record the owner of the current table.

•	PB Font. Use this group box to select the text object type (Data, Headings, or Labels) for which you want to set text characteristics. The Font and Size combo boxes let you specify the text font and size for the selected text object type. The B, I, and U check boxes let you apply boldface, italic, or underlined text style, respectively.

•	PBL File. Use this text box to enter the DOS path of the PowerBuilder library in which the DataWindow created from the selected entity is stored. You can also use the Browse button to locate the PBL file. See Selecting a PowerBuilder Library for ERwin-Generated DataWindows for more information.

•	Comment. Use this text box to enter a comment as it relates to the assigned PowerBuilder table properties.

•	Create DW. Use this button to create a DataWindow from the entity. See To create a DataWindow for a Drop Down DW edit style for more information. See the PowerBuilder documentation for more information on specifying DataWindow properties.

•	PB Sync. Click to synchronize the edit styles in the ERwin model with the PowerBuilder dictionary. Only edit styles are synchronized. See Synchronizing ERwin with the PowerBuilder Dictionary for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics:

  To assign PB extended attributes to a table or view

  Using the Table Editor

  Using the View Editor


To assign PB extended attributes to a table or view

1.	Right-click on a table, choose Table Editor from the shortcut menu, then choose PowerBuilder to open the PowerBuilder tab in the <Database> Table Editor.

OR

Right-click on a view, choose View Editor from the shortcut menu, then select the PowerBuilder tab in the View Editor.

2.	Click the Data, Headings, or Labels radio button in the PB Font option group to select the text object type for which you want to set text characteristics.

3.	Choose the font, font size, and text characteristics you want to apply to the selected object type. Select the appropriate B, I or U check box to apply boldface, italic, or underline styles.

4.	Repeat steps 2 and 3 for each text object type (Data, Headings, or Labels) for which you want to set characteristics.

5.	Click in the Comment text box to enter or edit a text comment for the selected entity.

6.	Enter the path and name of the PowerBuilder library in which you want to create a DataWindow in the PBL File box.

OR

Click the Browser button and choose the directory and name of the PBL file in which you want to create the DataWindow for the selected table.

7.	When you have finished, you can choose another table from the Table list or click OK to close the <Database> Table Editor.


Synchronizing ERwin and PowerBuilder

If you have defined edit styles, display formats, or other PB extended attributes in either ERwin or PowerBuilder, you can use ERwin’s bi-directional link to the PowerBuilder dictionary to update the definitions stored in the other environment. Exchanging data dictionary information between ERwin and PowerBuilder is accomplished in much the same way as when you synchronize an ERwin data model with a database: you log on to the target server, select the synchronization options, and then perform the synchronization.

This topic explains how to establish the connection between ERwin and PowerBuilder so that your ERwin data models can share information with PowerBuilder dictionaries. By importing PB extended attribute information from PowerBuilder into ERwin, you can make your data model more descriptive. You can also edit and modify these PB extended attributes as you work in your ERwin diagram, and you can export your changes and additions back to PowerBuilder.

Related Topics

  Synchronizing ERwin with the PowerBuilder Dictionary

  Setting PB Synchronization Options

  Running the PB Synchronization Process

  Using the PB Sync Dialog

  Creating a PB Impact Report

  Synchronizing PB Extended Attributes from an ERwin Editor


Synchronizing ERwin with the PowerBuilder Dictionary

When you create a PowerBuilder DataWindow, the PowerBuilder data dictionary stores extended attributes for each database column in the DataWindow, such as a descriptive comment, display format, edit style, field label, default value, and validation rule. The PB Sync Option on the ERwin Client menu links the ERwin data model to the PowerBuilder data dictionary so that they can exchange this client-side column property data.

If you have already developed a PowerBuilder application, you can begin by importing your existing PowerBuilder information into the ERwin data model. Thereafter, as additions or modifications are made to either the PowerBuilder dictionary or the ERwin model, you can use ERwin’s synchronization features to update the corresponding information in the other environment.

If you’re developing a new database application from scratch, you can define both server-side column properties and PB extended attributes and assign them to the appropriate columns in ERwin. You can then export these ERwin-created definitions to PowerBuilder.

For either of the above scenarios, the synchronization procedure is identical.

1.	Connect both ERwin and PowerBuilder to the target server and synchronize the ERwin data model with the database.

2.	Set the PB Synchronization Options in ERwin.

3.	Perform the synchronization. ERwin lets you examine and confirm each step of the process.

Related Topics

  Setting PB Synchronization Options

  Running the PB Synchronization Process

  Using the PB Sync Dialog

  Creating a PB Impact Report

  Synchronizing PB Extended Attributes from an ERwin Editor


Setting PB Synchronization Options

After you log on to the target server, use the PB Synchronization Options dialog to specify what PB extended attributes you want to synchronize and how to handle the synchronization process (batch or one group of extended attributes at a time).

When you choose PB Sync Options from the Client menu, ERwin displays the PB Synchronization Options dialog with the following groups of controls:

The purpose of each control in the PowerBuilded Extended Att. group box is explained below:

•	Table Extended Atts. Select this check box if you want ERwin to also synchronize the table-level assignment information for all extended attributes. The default is to include all extended attributes and table-level assignments in the synchronization.

•	Column Extended Atts. Select this check box if you want ERwin to also synchronize the column-level assignment information for all extended attributes. The default is to include all extended attributes and column-level assignments in the synchronization.

The purpose of each control in the PB Sync Options group box is explained below:

•	Detect New PB Ext Atts. Select this check box to display the edit styles, displays formats, and validation rules that currently exist in PowerBuilder but not in ERwin. This option is selected by default.

•	Impact Report Only. Select this check box to generate a report on all the changes that synchronization will apply. The actual synchronization is not performed. By selecting Impact Report Only and Batch All, you can create a single report on all potential impacts.

The purpose of each control in the Batch Option group box is explained below:

•	Separate All. Click this button to synchronize the extended attribute types and the table and column-level assignments separately. This option is selected by default.

•	Batch Entities. Click this button to synchronize each extended attribute type separately, but synchronize table and column-level assignments together as a batch process.

•	Batch All. Click this button to synchronize all extended attribute types and all table and column-level assignments together in one uninterrupted process.

The purpose of each control in the DB Sync Options group box is explained below:

•	First Sync with DB. Select this check box to synchronize ERwin tables and columns with the database before synchronizing them with PowerBuilder. ERwin displays, and allows you to fix, any discrepancies between the ERwin model and the database before attempting to synchronize table and column-level extended attributes with PowerBuilder. See Using Complete Compare for more information.

•	Update PB w/DB Changes. Select this check box to update the PowerBuilder dictionary tables if ERwin successfully renames a database table or column.

Note:	On SQL Server and SYBASE, the Update PB w/DB Changes option also updates the PowerBuilder dictionary tables with table id changes. This prevents losing the extended attribute information when the table is dropped and re-created.

The purpose of each control in the Save Sync Info. group box is explained below:

•	Last PB Values. Select this check box to save the extended attributes in the PowerBuilder dictionary. ERwin uses this recorded information to set appropriate default actions the next time you synchronize with PowerBuilder. This option is selected by default.

•	Last ERwin Values. Select this check box to save the extended attributes in the ERwin diagram.

Note:	If both Last PB Values and Last ERwin Values are selected, ERwin records the values in both environments. If you choose both options, ERwin is able to detect if a value has been changed by ERwin, PowerBuilder, or both since the previous synchronization.

The purpose of each control in the Last Resort Resolution group box is explained below. The option you select is used only if no previous synchronization information is available. It is also used to provide a default synchronization action for display/data value lists used by edit styles.

•	Update ERwin. Click this button to automatically import changes in the PowerBuilder data dictionary into the ERwin data model.

•	Update PowerBuilder. Click this button to automatically export changes in the ERwin data model to the PowerBuilder data dictionary.

•	Ignore Differences. Click this to ignore any differences between the ERwin data model and the PowerBuilder data dictionary.

The purpose of the other controls in the PB Synchronization Options dialog is explained below:

•	Filter. Click this button to open the Report Filter Editor. You can then select specific tables or entities to apply the PB synchronization.

•	Help. Click this button to open the on-line help system.

•	Close. Click this button to close the ERwin/PowerBuilder Synchronization dialog.

•	PB Sync. Click this button to synchronize ERwin and PowerBuilder.

Related Topics

  To set PB synchronization options

  Running the PB Synchronization Process


To set PB synchronization options

1.	Choose PB Sync Option from the Client menu to open the PB Synchronization Options dialog.

2.	Select the options in the appropriate group box. More>

3.	Click the PB Sync button to begin synchronization. More>


Running the PB Synchronization Process

After you set the PB synchronization options, you can begin the synchronization by:

•	Clicking the PB Sync button in the PB Synchronization Options dialog.

OR

•	Choosing the Sync ERwin with PB option from the Client menu.

If you are not logged on to the target database, ERwin prompts you to log on. After you log on to the target server, ERwin queries the PowerBuilder data dictionary and then displays one or more dialog boxes that list the differences between the PB extended attributes defined in ERwin and the extended attribute information stored in the PowerBuilder data dictionary. For each item where the definition differs, ERwin shows what synchronization action it is set to perform.

The synchronization dialogs vary according to the batch option you have set. If you choose Separate All or Batch Entities, ERwin displays a separate dialog for each extended attribute type. If you choose the Batch All, option, ERwin displays all the extended attribute types in a single dialog. The extended attribute type of each object is indicated by an additional column, PB Type, on the left side of the list. See Setting PB Synchronization Options for more information.

The actual synchronization is not performed on the displayed set of objects until you click the Execute button in the PB Sync dialog. You can select and change the synchronization action for individual objects or for the entire set.

Related Topics

  Using the PB Sync Dialog

  Setting PB Synchronization Options

  To change the PB synchronization action for individual objects

  To change the PB synchronization action for multiple objects

  To change the PB synchronization action for all objects


Using the PB Sync Dialog

The list at the top of the PB Sync dialog shows objects that differ in the ERwin model and the PowerBuilder data dictionary.

Objects that exist only in PowerBuilder are indicated as <New in PB> in the PB Value column. When you first synchronize an ERwin model with PowerBuilder, you see the built-in PowerBuilder extended attributes represented this way.

Objects that exist only in ERwin are indicated as <New in ERwin> in the ERwin Value column.

Objects defined in both ERwin and PowerBuilder are displayed in the ERwin Value and PB Value columns; the name of the column property is listed in the PB Prop column or (if Batch All is selected) in the PB Ext Att column.

The default Sync actions that ERwin displays in the PB Sync dialog are based on the differences it detects by querying the PowerBuilder data dictionary. If any Save Sync Info options are selected in the PB Synchronization Options dialog, ERwin also displays the differences between the current values and the values saved from the previous synchronization. See Setting PB Synchronization Options for more information.

You can review and change the synchronization action for any object.

The purpose of each control in the Set Synch Action group box is explained below:

•	<------- Import. Click this button to import the PowerBuilder value to ERwin.

•	-------> Export. Click this button to export the ERwin value to PowerBuilder.

•	--------- Ignore. Click this button to take no import or export action.

Use the Set Sync Action group box to change the Sync action for an individual object. Use the All button to change the sync action for all the objects in the list.

The purpose of the other controls in the PB Synchronization Options dialog is explained below:

•	Impact Report. Click this button to generate a report that shows the effect of the synchronization before you execute it. See Creating a PB Impact Report for more information.

•	Execute. After you select the synchronization actions you want, click the button to perform the synchronization. When synchronization is complete, ERwin displays a summary of the results. Click OK to remove the message and return to the diagram. In order to view the synchronization results in PowerBuilder, you may need to reconnect PowerBuilder to the target database.

•	Help. Click to open the on-line help system.

•	Cancel. Closes the dialog and cancels any changes.

Note:	If you select the First Sync with DB option, ERwin synchronizes with the target database before executing the synchronizing with PowerBuilder.

Related Topics:

  To change the PB synchronization action for individual objects

  To change the PB synchronization action for multiple objects

  To change the PB synchronization action for all objects


To change the PB synchronization action for individual objects

1.	Choose PB Sync Option from the Client menu.

2.	Choose the synchronization options that you want to execute, then click the PB Sync button to open the PB Sync dialog. Depending on which synchronization options you select, the PB Sync dialog displays a filtered list of the PB Extended Attribute objects (for example, all edit styles) in the ERwin diagram and in the PowerBuilder data dictionary.

3.	Click on a object in the PB Extended Attribute list, then click a radio button in the Set Sync Action group box to change the sync action for the selected object:

•	Click the <------- Import to import the PowerBuilder value to ERwin.

•	Click the -------> Export to export the ERwin value to PowerBuilder.

•	Click the -------- Ignore to take no import or export action.

4.	Repeat step 3 for each object if you want to change the assigned synchronization action.

5.	Click the Execute button to perform the selected synchronization action.


To change the PB synchronization action for multiple objects

1.	Choose PB Sync Option from the Client menu.

2.	Choose the synchronization options that you want to execute, then click the PB Sync button to open the PB Sync dialog. Depending on which synchronization options you select, the dialog displays a filtered list of the PB extended attribute objects (for example, all edit styles) in the ERwin diagram and in the PowerBuilder data dictionary.

3.	Click on a object in the PB Extended Attribute list. Choose one of the following options:

•	To choose a contiguous group of objects, select an object, hold down the SHIFT key then click another object in the list.

•	To choose a non-contiguous group, use CTRL-click as you click objects.

4.	Click one of the radio buttons in the Sync Action button to set the sync action for all the selected objects:

•	Click the <------- Import button to import the PowerBuilder value to ERwin.

•	Click the -------> Export button to export the ERwin value to PowerBuilder.

•	Click the -------- Ignore button to take no import or export action.

5.	Click the Execute button to perform the selected synchronization action.


To change the PB synchronization action for all objects

1.	Choose PB Sync Option from the Client menu.

2.	Choose the synchronization options that you want to execute, then click the PB Sync button to open the PB Sync dialog. Depending on which synchronization options you select, this dialog displays a filtered list of the PB extended attribute objects (for example, all edit styles) in the ERwin diagram and in the PowerBuilder data dictionary.

3.	In the PB Sync dialog, click one of the following buttons:

•	Click the << Import All button to import all PowerBuilder values into ERwin.

•	Click the >> Export All button to export all ERwin values to PowerBuilder.

•	Click the --Ignore All button to ignore any difference and take no import or export action.

4.	Click the Execute button to perform the synchronization.


Creating a PB Impact Report

The Impact Report button in the lower-left corner of any synchronization dialog lets you generate a report that shows the effect of the synchronization process before you execute it. When you click the Impact Report button, ERwin displays the Impact Report dialog.

This dialog works like the other ERwin report editor dialogs. You can modify the default report content and format by selecting the appropriate options.

Related Topics

  To create a PB impact report


To create a PB impact report

1.	Choose PB Sync Option from the Client menu.

2.	Choose the synchronization options that you want to execute, then click the PB Sync button to open the PB Sync dialog. Depending on which synchronization options you select, this dialog displays a filtered list of the PB extended attribute objects (for example, all edit styles) in the ERwin diagram and in the PowerBuilder data dictionary.

3.	Set the synchronization action for each object you want to include in the synchronization process.

4.	Click the Impact Report button to open the Impact Report dialog.

5.	Click the synchronization options you want to include in the report.

6.	Choose one of the following options:

•	Click the Preview button to view the report before generating it.

•	Click the Print button to print the report.

•	Click the Report button to display the Generate PB Impact Analysis Report dialog which lets you save the report to a file.

•	Click the Close button to close the Impact Report dialog.


Synchronizing PB Extended Attributes from an ERwin Editor

You can perform incremental synchronization as you work in ERwin’s Edit Style, PB Display Format, Validation Rule, and Column Property Editors by clicking the PB Sync button. In each case, only the PB extended attributes related to the active editor are synchronized. For example, if you click the PB Sync button from the PB Display Format Editor, only display formats are synchronized.

Note:	When you sync from an ERwin editor, other synchronization options, such as Save Sync Info, are enforced, but other types of table and/or column properties are not synchronized.

Related Topics

  To synchronize a specific set of PB extended attributes


To synchronize a specific set of PB extended attributes

1.	In the Edit Style Editor, PB Display Format Editor, Validation Rule Editor, Column Editor, or View Editor, click on the PB Sync button.

2.	Choose the synchronization options that you want to execute, then click the PB Sync button.

3.	Click on an object in the PB Extended Attribute list, and then choose one of the following options in the Sync Action dialog to set the sync action for the selected object:

•	Click the <------- Import button to import the PowerBuilder value to ERwin.

•	Click the -------> Export button to export the ERwin value to PowerBuilder.

•	Click the -------- Ignore button to take no import or export action.

4.	Click the Execute button to perform the synchronization.


Using ERwin as a PB Data Source

You can use an ERwin data model as a data source for building your PowerBuilder application forms and dialogs. If you define both your server-side column properties and PB extended attributes in ERwin, you can automatically create PowerBuilder DataWindows that know how to display the information in each column.

To use ERwin to generate a PowerBuilder DataWindow, you must start ERwin and open the data model you want to use as the data source before you open the ERwin DataWindow Wizard. The ERwin DataWindow Wizard uses the information in the data model to automatically create DataWindows for the PowerBuilder application.

Related Topics

  How ERwin Generates PowerBuilder DataWindows

  Creating PowerBuilder DataWindows Using ERwin

  Selecting a PowerBuilder Library for ERwin-Generated DataWindows

  Using the ERwin DataWindow Wizard

  DataWindow Presentation Styles

  Modifying DataWindows in PowerBuilder


How ERwin Generates PowerBuilder DataWindows

A PowerBuilder DataWindow is a control that lets you display and manipulate data from a data source. An ERwin data model includes all the data source information required to generate a PowerBuilder DataWindow. To transfer data source and column display information to PowerBuilder, ERwin for PowerBuilder provides a series of dialogs called the ERwin DataWindow Wizard.

Using your responses to determine which tables and columns to use, the DataWindow Wizard automatically generates PowerBuilder DataWindows based on information in the active ERwin diagram. When you use the DataWindow in a PowerBuilder application, it reads information from and writes information to the application database (the database in which the application data is stored).

Note:	The ERwin DataWindow Wizard lets you automatically generate a DataWindow for each entity in your diagram. Alternatively, you can use the DataWindow Wizard to select specific entities and attributes and generate DataWindows one-at-a-time or in groups (for example, you can generate a DataWindow for each entity in an ERwin subject area).

Related Topics

  Creating PowerBuilder DataWindows Using ERwin

  Selecting a PowerBuilder Library for ERwin-Generated DataWindows


Creating PowerBuilder DataWindows Using ERwin

Using the ERwin DataWindow Wizard, you can create DataWindows that you can use in PowerBuilder Window controls to build sophisticated application screens. After ERwin creates a DataWindow, you can modify the attributes of the DataWindow, and the attributes of each control in the DataWindow, using the wide array of features that PowerBuilder offers.

To use ERwin to generate a PowerBuilder DataWindow requires two steps:

1.	Open the ERwin diagram that you want to use as a data source and select the PowerBuilder library in which you want to store ERwin-generated DataWindows. See Selecting a PowerBuilder Library for ERwin-Generated DataWindows for more information.

2.	Start the ERwin DataWindow Wizard and use it to select the table and columns that you want the DataWindow to display. See Using the ERwin DataWindow Wizard for more information

Note:	To ensure that ERwin-generated DataWindows reflect the edit styles defined in your ERwin data model, synchronize the ERwin diagram with the PowerBuilder data dictionary before generating the DataWindows. See Synchronizing ERwin with the PowerBuilder Dictionary for more information.

During a single ERwin session, you can generate DataWindows to only one PBL file. To generate DataWindows to another PBL file, you must close and restart ERwin, then choose the new PBL file in the Target Client dialog. See Selecting a Target Client for more information.

Related Topics

  Selecting a PowerBuilder Library for ERwin-Generated DataWindows


Selecting a PowerBuilder Library for ERwin-Generated DataWindows

A PowerBuilder library is a file with the extension PBL where PowerBuilder stores DataWindows and other application objects. The DataWindows that you create with ERwin are automatically stored in a PowerBuilder library (PBL) file. To specify the destination library, enter the PBL File name in the text box on the bottom of the Target Client dialog.

Related Topics

  To specify the PowerBuilder library for ERwin-generated DataWindows


To specify the PowerBuilder library for ERwin-generated DataWindows

1.	Open the ERwin diagram that contains the entities you want to use to generate PowerBuilder DataWindows.

2.	Select Target Client from the Client menu to open the Target Client dialog.

3.	In the PBL File edit box, enter the DOS path and filename of the PowerBuilder library (PBL file) in which you want to store the DataWindows generated by ERwin, or click the Browse button to select the drive, directory, and PBL file.

4.	Click OK to save the library setting.

Note:	A DataWindow must be generated in a PowerBuilder application. During installation, ERwin stores the ERWINAPP application in the ERWINAPP.PBL PowerBuilder library file. Do not delete ERWINAPP.PBL; ERwin needs to access this file in order to generate DataWindows.


Using the ERwin DataWindow Wizard

After you select the PowerBuilder library in which to store the generated DataWindows, you choose Create DW from the Client menu to open the DataWindow Wizard dialog. The DataWindow Wizard dialog lets you select the tables (entities) ERwin uses to generate DataWindows.

The ERwin DataWindow Wizard dialog also displays the name of each entity in the current data model in the Available Tables list on the left side of the dialog. Double-click on each table for which you want to generate a DataWindow. Selected tables are displayed in the Selected Tables list on the right side of the dialog.

Note:	Instead of double-clicking, you can use the [image] and [image] buttons to add and remove tables from the Selected list.

By using the DataWindow Wizard dialog, you can specify a presentation style for the selected tables. The presentation style you choose applies to all the selected tables. The presentation style options are: Freeform, Tabular, or Grid. See DataWindow Presentation Styles for more information.

The DataWindow Wizard dialog also lets you enter the prefix that precedes each DataWindow name. The default prefix is dw_, but you can click in the DataWindow Name Prefix box and enter a different prefix if you have your own PowerBuilder naming conventions.

Note:	When you exit ERwin, the DataWindow Name Prefix value is retained for the next ERwin session.

When you finish making selections in the DataWindow Wizard dialog, click the Finish button. ERwin displays the Creating DataWindows dialog, which displays status messages as ERwin creates DataWindows for each selected table. At any time, you can click the Cancel button to close the DataWindow Wizard dialog and cancel the DataWindow creation process.

When ERwin finishes creating the requested DataWindows, it displays the message Generation Completed - n DataWindows Created, where n is the number of tables you selected. Click OK to close the dialog.

Note:	If PowerBuilder is not running on your system, ERwin starts PowerBuilder before it generates the DataWindows.

In addition to selecting the Create DW option on the Client menu, ERwin lets you initiate the DataWindow creation process from the Table Editor, View Editor, and the PB Edit Style Editor:

•	Creating a DataWindow from the Table Editor or View Editor. Use the PowerBuilder tab on Table Editor or View Editor to generate a DataWindow for the currently selected table or view. If you create a DataWindow from the Table Editor or View Editor, you can control the text characteristics of the DataWindow’s data, headings, and labels, and you can select which columns to include in the DataWindow. See To create a DataWindow from a single ERwin entity for more information.

•	Creating a DataWindow from the PB Edit Style Editor. Use ERwin’s PB Edit Style Editor to create a DataWindow which you can use to apply a Drop Down DataWindow style to a column. If you create a DataWindow from the PB Edit Style Editor, you can select which table and columns to include in the Drop Down DataWindow. See To create a DataWindow for a Drop Down DW edit style for more information.

Related Topics

  DataWindow Presentation Styles

  To create DataWindows from several ERwin tables

  To create a DataWindow from a single ERwin table

  To create a DataWindow for a Drop Down DW edit style


DataWindow Presentation Styles

The DataWindow Wizard dialog lets you specify one presentation style for all the selected tables. The presentation style options include:

•	Freeform. The Freeform style creates a standard single record layout by placing all data controls and their labels in the detail band of the DataWindow object. You can move and resize the labels and controls in PowerBuilder. The header band is blank.

•	Tabular. The Tabular style creates a tabular multi-record layout by placing the column names in a single row in the detail band of the DataWindow object. The default headers are positioned at the top of the columns in the header band.

•	Grid. The Grid style is the same as the Tabular style, except it displays vertical rules between the columns. The grid lines are only displayed when you place the DataWindow object in a window control or when you print the DataWindow.

Related Topics

  Using the ERwin DataWindow Wizard


To create DataWindows from several ERwin tables

1.	Choose Create DW from the Client menu.

2.	In the DataWindow Wizard dialog, double-click on each table you want to use to create a DataWindow in the Available Tables list on the left side of the dialog. Selected tables are displayed in the Selected Tables list on the right side of the dialog.

3.	In the Presentation Style group box, click on the presentation style you want to assign to all the DataWindows that will be generated by ERwin.

4.	Click in the DataWindow Name Prefix text box and enter the prefix you want to apply to all DataWindow names or accept the "dw_" default prefix.

5.	Click the Finish button.

6.	When the Generation Completed - n DataWindows Created message appears, click OK.

Note:	Before it generates the DataWindows, ERwin checks the names of all the existing DataWindows in the PowerBuilder target library. If PowerBuilder is not already running on your system, ERwin starts PowerBuilder before it generates the DataWindows.

If the selected PowerBuilder library contains one or more DataWindows that have the same name as the DataWindows ERwin is about to generate, ERwin prompts you to confirm if you want to overwrite the existing DataWindows with the new ERwin-generated DataWindows.


To create a DataWindow from a single ERwin table

1.	Choose Table from the Editor menu, click on the PowerBuilder tab.

OR

Right-click on an entity, choose Table from the shortcut menu, then choose PowerBuilder.

2.	Select the table you want to use to create a DataWindow from the Table box.

3.	Click the Data, Headings, or Labels radio button in the PB Font group box, and set the text characteristics for the data, headings, or labels of the DataWindow as follows:

4.	Click in the Comment text box and edit or enter the DataWindow comment text.

5.	Click in the PBL File text box and enter the DOS path of the PowerBuilder library (PBL) file in which you want the ERwin-generated DataWindows to be stored.

6.	Click the Create DW button.

7.	Click in the DataWindow Name text box in the DataWindow Wizard dialog and enter the name you want to assign to the DataWindow.

8.	Optionally, click in the Comment text box and enter a DataWindow comment.

9.	Click the Freeform, Grid, or Tabular radio button in the Presentation Style group box to select a presentation style for the DataWindow.

10.	Click the Next> button.

11.	Double-click on each column that you want to include in the DataWindow in the Available Columns list.

12.	When you have selected all the columns you want to include in the DataWindow, click the Finish button.

Note:	If PowerBuilder is not already running on your system, ERwin automatically starts PowerBuilder before it generates a DataWindow.

To assign a Drop Down DW edit style to an existing DataWindow, PowerBuilder must be running on your computer, and you must select the PowerBuilder Library (PBL) file that contains the DataWindow. You can also use ERwin to create the DataWindow used in the Drop Down DW edit style. See To create a DataWindow for a Drop Down DW edit style for more information.


To create a DataWindow for a Drop Down DW edit style

1.	Choose the PB Edit Styles menu option from the Client menu to open the Edit Style Editor.

2.	Click the Drop Down DW radio button. ERwin displays controls that let you specify the attributes of the DataWindow control.

3.	Click the Create DW button. ERwin displays the DataWindow Wizard dialog.

4.	Click in the DataWindow Name text box and enter the name you want to assign to the DataWindow.

5.	Optionally, click in the Comment box and enter a DataWindow comment.

6.	Click the Freeform, Grid, or Tabular radio button in the Presentation Style group box to select a presentation style for the DataWindow.

7.	Click the Next> button. ERwin display three list controls that let you choose a table and the columns that you want to include in the DataWindow.

8.	Click the down arrow in the Table list and select a table from the list displayed. ERwin displays the table’s columns in the Available Columns list.

9.	Double-click on each column that you want to include in the DataWindow in the Available Columns list. The columns that you select are displayed in the Selected Columns list on the right side of the DataWindow Wizard dialog.

10.	When you have selected all the columns you want to include in the DataWindow, click the Finish button. After ERwin creates the DataWindow, switch to PowerBuilder and select the DataWindow Painter from the toolbar to view the new DataWindow.

Note:	If PowerBuilder is not already running on your system, ERwin automatically starts PowerBuilder before it generates a DataWindow.


Modifying DataWindows in PowerBuilder

You can reposition or resize the objects in a DataWindow created by ERwin by selecting and dragging the objects or their borders. Use the PowerBuilder DataWindow Painter to modify the attributes of individual objects and labels.

Note:	The changes you make to a DataWindow in PowerBuilder are not applied to the ERwin data model. If you make changes to a DataWindow in PowerBuilder, your changes will be overwritten if ERwin subsequently re-generates the DataWindow.


Using ERwin with Visual Basic

ERwin works seamlessly with Visual Basic version 4.0 and 5.0 from Microsoft Corporation. Based on Logic Works' wizard-like technology, you can use ERwin to import your data model into the VB design environment as a custom object that stores both the physical table structure and the client application visual display information. Using the ERwin model as the data source for a VB form, the ERwin Form Wizard automates the form design process — automatically generating a sophisticated form with data-aware controls such as drop-down list boxes, combo boxes and option buttons.

Using ERwin, you can manage both client-oriented information like Visual Basic controls and server-oriented information like triggers, stored procedures, and physical storage objects from within ERwin. By assigning client-side display properties to database columns in ERwin, you can significantly speed up your application development tasks. Because both the physical table structure and client display properties for each column are stored together, the ERwin Form Wizard can automatically generate forms that display data in predefined styles such as edit boxes, drop-down lists, option button groups etc. So, you don't have to assign these properties to controls one-at-a-time in Visual Basic.

To further enhance your productivity, you can use ERwin domains to assign multiple client and server-side properties to a column with a single mouse-click. Using ERwin domains helps you integrate and automate the process of physical database and visual interface design in one unified environment. When you change a property value in a domain, ERwin changes the property value of all the controls associated with that domain.

Together, ERwin and Visual Basic form a complete database design environment for client-server development. You can use the best tools for each part of the development process:

•	Visual Basic for building and maintaining sophisticated GUI client applications.

•	ERwin for developing the logical data model, including relationship descriptions, rolenames, foreign key migration, referential integrity rules, and other database design and maintenance functions, along with forward and reverse engineering (FRE), and a direct link to the database catalog.

You can forward engineer your physical database directly from your ERwin data model and then use Visual Basic to build your application on top of the normalized data structure. Or, when a database already exists, you can reverse engineer it into an ERwin diagram, and then use the ERwin toolset to migrate the database schema to a different target database.

Related Topics

  Defining VB Client Information


Defining VB Client Information

Because ERwin supports Visual Basic application development, you can create column properties that control how the data stored in a column is displayed in a Visual Basic application. After you define these Visual Basic column properties, you assign them to database columns just as you assign database column properties, like the datatype, to a column.

Most of the ERwin dialogs for defining Visual Basic column properties are extended versions of the editors that are used to define database server column properties.

For more information on defining database server column properties and using the associated ERwin editors, see Using the Column Editor.

Note:	When you create, modify, or assign column properties to database columns in ERwin, you must export these changes to Visual Basic. See Using ERwin as a VB Data Source, for more information.

Related Topics

  Selecting a Target Client

  ERwin VB Client Menu

  Assigning VB Properties to Database Columns

  Assigning VB Properties to a View Column

  Using the VB Edit Style Editor

  Using the VB Display Format Editor

  Defining VB Validation Rules

  Defining VB Valid Values

  Defining VB Client Defaults

  Assigning VB Column Properties to a Domain

  Migrating VB Column Properties

  Globally Resetting VB Column Properties


ERwin VB Client Menu

Using the ERwin VB client menu, you can define Visual Basic column properties in your physical model.

ERwin Client Menu options for Visual Basic are listed below:

•	VB Edit Styles. Choose this menu item to define column edit styles.

•	VB Display Format. Choose this menu item to define column display formats.

•	Validation Rule. Choose this menu item to define column validation rules.

•	Valid Value. Choose this menu item to define column valid values.

•	Default/Initial. Choose this menu item to define column default and initial values.

•	Target Client. Choose this menu item to choose Visual Basic as your target client development platform. You can also reset VB column properties.

Note:	After you install ERwin for Visual Basic, the Add-ins menu in Visual Basic 4.0 and 5.0 contains an item called "ERwin," which you use to start the ERwin Form Wizard. See Using ERwin with Visual Basic 4.0 or 5.0 for more information. If you try to start the ERwin Form Wizard and ERwin for Visual Basic is not running, Visual Basic automatically starts ERwin for you.


Assigning VB Properties to Database Columns

In the same way that you use the database tabs of the ERwin Column Property Editor to assign database server properties, such as column name and datatype to database columns, you can use the Visual Basic tabs of the Column Property Editor to attach Visual Basic properties, such as user interface controls and validation rules, to each column. Also, just as you can combine physical column properties into ERwin domains to streamline the database design process, ERwin lets you incorporate visual column properties into domains to speed the client application development process. See Assigning VB Column Properties to a Domain for more information.

Related Topics:

  To assign VB properties to a database column

  Using the Column Editor to Assign VB Column Properties

  Using the Column Editor


To assign VB properties to a database column

1.	Choose Column from the Edit menu, and then select a table from the Table list.

OR

Right-click on the table, then choose  Column Editor from the shortcut menu.

OR

If assigning column properties to a view, choose View from the Edit menu and then select a view column from the Column box.

2.	Click on the either of the Visual Basic tabs. More>>

3.	Assign the appropriate column properties.


Assigning VB Properties to a View Column

Using the Visual Basic tabs in the View Column Editor, you can assign Visual Basic properties to a selected view column. You can assign Visual Basic properties to a view column in the same way you assign Visual Basic properties to a table column. Simply select a view and choose View Column Editor from the shortcut menu, then click on the appropriate Visual Basic tab and specify the properties you want.

Related Topics

  To assign VB properties to a view column

  Using the Column Editor to Assign VB Column Properties

  Assigning VB Properties to Database Columns

  Using the View Column Editor


Using the Column Editor to Assign VB Column Properties

Using the Column Editor, you can assign Visual Basic properties or ERwin domains to the columns in a database table. The Column Editor also provides quick access to ERwin editors for creating and modifying Visual Basic column properties and domains.

To assign a Visual Basic property to a table column, first, select the table that contains the columns from the Table list at the top of the editor. Then, select the column in the Column list and assign the VB properties using the controls for each property.

Use the [image] button to open the editor associated with that control, where you can create and edit control options.

The purpose of each control in the first Visual Basic tab is explained below:

•	Style. Select to apply an edit style to the selected column.

•	Valid. Select to apply a validation rule to the selected column.

•	Initial. Select to apply an initial value to the selected column.

•	Help ID. Enter a help context number for the VB control. The help context number identifies a particular Windows help topic which provides information about the Visual Basic object when the user requests context-sensitive help [HelpContextID].

•	Read Only. Check this box to specify that the corresponding database column can only be read. Applies only if the Visual Basic control associated with the database column is a Data Control [ReadOnly].

•	Bitmap. Check this box to specify that the data in the corresponding database column is a bitmap.

•	Required. Check this box to require user input, that is, the control cannot be left blank. If it is left blank, Visual Basic displays a message prompting input.

•	Empty Is Null. Check this box to assign a null value to the corresponding column.

•	Visible. Check this box to display the VB control. If you leave this box unchecked, the VB control is hidden when the form is displayed [Visible].

•	Tag. Type descriptive text for the VB control associated with the corresponding column. This property is for identification purposes only. Visual Basic does not use this property for any other purpose [Tag].

•	Prompt. Enter text that is displayed (in the status bar generally) when the control has input focus.

Note:	To provide Context-Sensitive help, you must create a .HLP Windows Help file and link it to your VB application.

The purpose of each control in the second Visual Basic tab is explained below:

•	Font Name. Choose a font name to appear in the Visual Basic application.

•	Font Style. Choose a font style to appear in the Visual Basic application.

•	Font Size. Choose a font size to appear in the Visual Basic application.

•	Foreground Color. Choose the color of the text to appear in the Visual Basic application.

•	Background Color. Choose the background color of your Visual Basic application. This control and the Foreground Color control are similar to those you use to change the text and color attributes of your ERwin diagram. See Defining Default Fonts and Colors for Diagram Objects for more information.

•	Label. Enter a text string of the caption associated with the VB control. Use the list next to the control to specify the text justification (left, center, right).

•	Header. Enter a text string of the header associated with the VB form. Use the list next to the control to specify the text justification (left, center, right).

•	Accel. Use this text box to specify the accelerator key you can use to move the input focus onto the VB control.

•	Migrate. Click this button to specify which Visual Basic column properties migrate across relationships in the same way that you specify which server-side column attributes migrate across relationships. When you click this button, ERwin displays the Visual Basic Migrate Column Property dialog.

The other controls in the Visual Basic Column Editor work like their counterparts in the standard ERwin Column Editor.

Related Topics:

  Creating and Modifying VB Column Properties

  Migrating VB Column Properties

  Using the Column Editor


Creating and Modifying VB Column Properties

ERwin provides five editors for creating and modifying Visual Basic column properties:

•	VB Edit Style Editor

•	Display Format Editor

•	Validation Rule Editor

•	Valid Value Editor

•	Default/Initial Value Editor

By using the VB Edit Style and Display Format Editors, you can choose the type of Visual Basic control that ERwin creates for each column, and specify certain properties for each type.

The Validation Editor, Valid Values Editor, and Default/Initial Value Editor are identical to the editors of the same name found in the ERwin server menu. If you have used any of these editors to define server-side column properties, you’ll find the process of assigning Visual Basic column properties very familiar.

You can also use the Domain Dictionary Editor to assign both client and server-side column properties to named domains.

Related Topics:

  To open any of the VB column property editors

  Assigning VB Column Properties to a Domain

  Using the Domain Dictionary Editor in the Physical Edit Mode


To assign VB properties to a view column

1.	Right-click on the view and choose View Column Editor from the shortcut menu.

2.	Click on the either of the Visual Basic tabs.

3.	Assign the column properties you want in the tab.

4.	Click OK.


To open any of the VB column property editors

1.	Choose the appropriate option from the Client menu.

OR

Right-click on an entity and choose Column Editor from the displayed shortcut menu.

OR

Right-click on a view and choose View Column Editor from the displayed shortcut menu.

2.	Select the first Visual Basic tab.

3.	Click on the [image] button next to the appropriate property (Style, Valid, or Initial).


Using the VB Edit Style Editor

The VB Edit Style Editor lets you create and modify edit styles that determine how users view, enter, and edit information in a Visual Basic application. When you assign an ERwin Edit Style to a database column, you associate the database column with a specific type of Visual Basic control.

The following table shows the edit styles you can create in ERwin:

	Edit. This style corresponds to the VB Text Box control that lets you enter text. This is the default edit style that ERwin assigns when you create a new edit style.
	Edit Mask. This style corresponds to the VB Masked Edit control that lets you enter text according to a predefined format.
	List Box. This style lets you choose items from a predefined list (this style is often used to display a list of valid values).
	Combo Box. This style lets you browse and choose items from a list that opens up when you click the down arrow to the right of the control. You can also type a new value in the control.
	Check Box. This style lets you select or deselect a displayed choice by clicking in the box graphic.
	Option Button. This style lets you choose one item from a short list by clicking in the circular graphic.
	Gauge. This style lets you display a value relative to a scale that shows the allowed range of that value.
	Picture Box. This style lets you display a picture if the data in the associated column is a graphic instead of text.
	Image. This style lets you display an image if the data in the associated column is an image instead of text. The VB image control uses fewer resources and repaints faster than a picture box control.
Related Topics:

  Setting VB Edit Style options

  To create or modify a VB edit style


Setting VB Edit Style options

Each ERwin edit style has additional options to control the display and entry of data. In the ERwin VB Edit Style Editor, you can modify these options in a similar manner to setting the properties of the corresponding control in Visual Basic.

For all ERwin edit styles, you can specify the Height, Width and Pointer type of the corresponding Visual Basic control:

•	Height & Width. Enter a numeric value (in pixels) that represents the position of the control relative to the top left corner of the form.

•	Pointer. A pointer is displayed when you position the mouse over the VB control. Click on the Pointer list and choose the type  from the list displayed (None, Arrow, Cross-Hair, I-Beam, Icon, Size, Size NE/SW, Size N/S, Size NW/SE, Size W/E, Up Arrow, Hourglass, No Drop).

The List Box, Combo Box, Check Box, and Option Button edit styles can be used to display the list of valid values defined by a validation rule. To associate a validation rule with an edit style, choose a validation rule from the Validation list. See Defining VB Validation Rules  for more information.

After you choose a specific edit style, ERwin displays a property group box. The property group box lets you specify additional attributes for the selected edit style.

Related Topics:

  VB Edit Style Properties

  VB Edit Mask Style Properties

  VB List Box Style Properties

  VB Combo Box Style Properties

  VB Check Box Style Properties

  VB Option Button Style Properties

  VB Gauge Style Properties

  VB Picture Box Style Properties

  VB Image Style Properties


VB Edit Style Properties

When you assign an edit style to a column using the VB Edit Style Editor, ERwin displays the Edit Property group box, which lets you set additional properties for the VB Text Box control.

The purpose of each control in the Edit Property group box is explained below:

•	Limit. Enter a number to set the maximum number of characters you can enter in the VB control. A value of zero indicates that there is no limit [MaxLength].

•	Case. Select the case option (any, UPPER, lower) of the text in the VB control.

•	Align. Select the alignment option (left, center, or right) of the text in the VB control [Alignment].

•	Password. Enter a character placeholder that is automatically displayed in the VB control instead of the characters typed by the user [PasswordChar].

•	Use Code Table. Select this check box to indicate that there is a validation rule associated with the VB control. If the Use Code Table box is selected, ERwin displays validation controls in the VB Edit Style Editor window. If the Use Code Table box is cleared, there is no validation rule associated with the VB control.

•	Hide Selection. Select this check box to specify if the text in the VB control should remain highlighted when the control loses focus [HideSelection].

•	Border. Select this check box to assign a fixed single line border to the VB control. If you leave this box unchecked, the VB control does not have a border [BorderStyle].

•	Auto Select. Select this check box to specify that the control automatically gains focus when the form is selected.

•	Multiline. Select this check box to indicate that the VB text box can accept and display multiple lines of text [Multiline].

•	H Scroll Bar. Select this check box to specify that the VB control has a horizontal scroll bar. This option is unavailable if the Multiline option is not selected [ScrollBars=1].

•	V Scroll Bar. Select this check box to specify that the VB control has a vertical scroll bar. This option is unavailable if the Multiline option is not selected [ScrollBars=2].

•	Validate Using CT. Select this check box to indicate that the VB control's input is checked against the valid values defined by the selected validation rule. This option is unavailable if the Use Code Table option is not selected.

Note:	For each ERwin property, the equivalent Visual Basic property is shown in square brackets. Refer to your Visual Basic documentation for more information about a property.


VB Edit Mask Style Properties

When you assign the Edit Mask style to a column using the VB Edit Style Editor, ERwin displays the Edit Mask Property group box. You can set additional properties for the VB Masked Edit control.

The Purpose of each control in the Edit Mask Properties group box is explained below:

•	Mask. Enter an input mask, that is, a string of symbols that controls how you enter data in the VB control. For example, the input mask "(###) ###-####" lets you enter just the digits (and only digits) for a standard North American telephone number; the parentheses, space and hyphen are entered automatically. To apply a mask, click in the Mask text box and enter the string. Refer to your Visual Basic documentation for more information about the symbols that can be used in input masks [Mask].

•	Format. Select a display format from this list. The display format controls how data is displayed when the cursor leaves the field. For example, dd-mm-yy is a date format. To choose a display format, click the down arrow next to the Format list [Format].

Note:	Click the Format button to view and define display formats. See Using the VB Display Format Editor for more information.

•	Limit. Enter a number to specify the maximum number of characters in the VB control. The number you enter must be in the range 1 to 64 [MaxLength].

•	Prompt Char. Enter a character that VB uses to prompt for user input. The default character is the underscore (_) symbol [PromptChar].

•	Prompt Include. Select this check box to specify that non-editable mask characters are saved in the database. If you leave this box unchecked, non-editable mask characters are not saved in the database [PromptInclude].

•	Hide Sel. Select this check box to indicate that selected text in the VB control is hidden when the control loses focus. If you leave this box unchecked, selected text remains visible when the control loses focus [HideSelection].

•	Use Code Table. Select this check box to indicate that there is a validation rule associated with the VB control. If the Use Code Table box is checked, ERwin displays validation controls in the VB Edit Style Editor window. If the Use Code Table box is not checked, there is no validation rule associated with the VB control.

•	Validate Using CT: Select this check box to indicate that the VB control's input is checked against the valid values defined by the selected validation rule. This option is unavailable if the Use Code Table option is not selected.

Note:	For each ERwin property explained above, the equivalent Visual Basic property is shown in square brackets. Refer to your Visual Basic documentation for more information about a property.


VB List Box Style Properties

When you assign the List Box style to a column using the VB Edit Style Editor, ERwin displays the List Box Property group box. You can set additional properties for the VB List Box control.

The Purpose of each control in the List Box Property group box is explained below:

•	Columns. Enter a number to indicate if the VB list box scrolls vertically or horizontally. If you enter 0, the list box scrolls vertically. Otherwise, the number you enter determines the number of columns displayed in the VB List Box [Columns].

•	Multiple Sel. Select this check box to specify that a user can select multiple items in the VB list box [MultiSelect].

•	Sorted. Select this check box to indicate that the elements of the VB list box are automatically sorted in alphabetical order [Sorted].

Note:	For each ERwin property explained above, the equivalent Visual Basic property is shown in square brackets. Refer to your Visual Basic documentation for more information about a property.


VB Combo Box Style Properties

When you assign the Combo Box style to a column using the VB Edit Style Editor, ERwin displays the Combo Box Property group box. You can set additional properties for the VB Combo Box control.

The Purpose of each control in the Combo Box Property group box is explained below:

•	Combo Style. Click the down arrow and choose the style (DropDown, Simple, DropDownList) of the VB Combo Box [Style].

•	Length. Enter a number to specify the number of rows in the drop-down section of the combo box. This option is unavailable when the Combo Style option is set to DropDownList.

•	Sorted. Select this check box to specify that the items in the VB Combo Box are automatically sorted in alphabetical order [Sorted].

•	Validate Using CT. Select this check box to indicate that the VB control's input is checked against the valid values defined by the selected validation rule. This option is unavailable when the Combo Style option is set to DropDownList.

Note:	For each ERwin property explained above, the equivalent Visual Basic property is shown in square brackets. Refer to your Visual Basic documentation for more information about a property.


VB Check Box Style Properties

When you assign the Check Box style to a column using the VB Edit Style Editor, ERwin displays the Check Box Property Option group box. You can set additional properties for the VB Check Box control.

The Purpose of each control in the Check Box Property group box is explained below:

•	Text. Enter the text that is displayed next to the VB check box [Caption].

•	Data Value For. Enter a value that is saved in the corresponding column when the VB check box is On (checked) or Off (unchecked). The most common use of a check box is to record true/false values. For example a Married check box might have an "on" value of T (if checked) or an "off"  value of F (if left blank) [Value].

•	Left Text. Select this check box to specify that the VB check box label is displayed to the left of the check box. If you leave this box unchecked, the VB check box label is displayed to the right of the check box. [Alignment].

•	3D. Select this check box to specify that the VB check box is 3-dimensional. If you leave this box unchecked, the VB check box is 2-dimensional.

Note:	For each ERwin property explained above, the equivalent Visual Basic property is shown in square brackets. Refer to your Visual Basic documentation for more information about a property.


VB Option Button Style Properties

When you assign the Option Button style to a column using the VB Edit Style Editor, ERwin displays the Option Button Property group box. You can set additional properties for the VB Option Button control.

The Purpose of each control in the Option Button Property group box is explained below:

•	Columns Across. Enter a number to indicate the number of columns to use when laying out a group of option buttons.

•	Left Text. Select this check box to specify that the VB option button label is displayed to the left of the option button. If you leave this box unchecked, the VB option button label is displayed to the right of the option button [Alignment].

•	3D. Select this check box to specify that the VB option button is three-dimensional. If you leave this box unchecked, the VB option button is two-dimensional.

Note:	For each ERwin property explained above, the equivalent Visual Basic property is shown in square brackets. Refer to your Visual Basic documentation for more information about a property.


VB Gauge Style Properties

When you assign the Gauge style to a column using the VB Edit Style Editor, ERwin displays the Gauge Property group box. You can set additional properties for the VB Gauge control.

The Purpose of each control in the Gauge Style Property group box is explained below:

•	Picture. Enter the name of the picture file that contains the gauge graphic [Picture].

•	Picture File. Click the Picture File button to specify the location of the picture file that contains the gauge graphic. ERwin displays the ERwin Open File dialog that lets you choose the directory and file name of the gauge graphic.

•	Style. Choose a gauge type from the displayed list. The supported types are: Horizontal Bar, Vertical Bar, ‘Semi’ Needle (semi-circular needle), and ‘Full’ Needle (full-circle needle) [Style].

•	Inner Top. Enter a number (in pixels) to define the distance between the top of the gauge control and the top of the changeable (data) portion of the gauge control [InnerTop].

•	Inner Bottom. Enter a number (in pixels) to define the distance between the bottom of the gauge control and the bottom of the changeable (data) portion of the gauge control [InnerBottom].

•	Inner Left. Enter a number (in pixels) to define the distance between the left edge of the gauge control and the left edge of the changeable (data) portion of the gauge control [InnerLeft].

•	Inner Right. Enter a number (in pixels) to define the distance between the right edge of the gauge control and the right edge of the changeable (data) portion of the gauge control [InnerRight].

•	Min. Enter a number, in the range 0 to 32767, to specify the lower limit of the range represented by the gauge. The default is zero [Min].

•	Max. Enter a number, in the range 0 to 32767, to specify the upper limit of the range represented by the gauge. The default is 100 [Max].

•	Needle Width. Enter a number, in the range 0 to 32767, to specify the width, in pixels, of the needle on a needle-style gauge [NeedleWidth].

•	Auto Size. Select this check box to specify that the VB gauge is automatically resized to fit the area defined for displaying the gauge. If you leave this box unchecked, VB does not automatically resize the VB gauge to fit the defined area [AutoSize].

Note:	For each ERwin property explained above, the equivalent Visual Basic property is shown in square brackets. Refer to your Visual Basic documentation for more information about a property.


VB Picture Box Style Properties

When you assign the Picture Box style to a column using the VB Edit Style Editor, ERwin displays the Picture Box Property group box. You can set additional properties for the VB Picture Box control.

The Purpose of each control in the VB Style Property group box is explained below:

•	Align. Choose an alignment option from the displayed list (none, top, or bottom). If you choose none, the picture box can appear in any size anywhere on a form. If you choose top or bottom, the picture box appears at the top or bottom of the form and is automatically sized to fit the width of the form [Align].

•	Draw Mode. Choose a draw mode from the displayed list. The draw mode controls the appearance of the VB control. Draw mode options include: None, Black Pen, Not Merge Pen, Mask Not Pen, Not Copy Pen, Mask Pen Not, Invert, Xor Pen, Not Mask Pen, Mask Pen, Not Xor Pen, No Op, Merge Not Pen, Copy Pen, Merge Pen Not, Merge Pen, and White Pen [DrawMode].

•	Draw Style. Choose a draw style from the displayed list. The draw style controls the appearance of the VB control. Draw style options include: Solid, Dash, Dot, Dash Dot, Dash Dot Dot, Transparent, and Inside Solid [DrawStyle].

•	Draw Width. Enter a number (in points) that defines the line width used in a graphic [DrawWidth].

•	Auto Redraw. Select this check box to enable the automatic repainting of a VB picture box. If you leave this box unchecked, VB does not automatically repaint the VB picture box [AutoRedraw].

•	Border. Select this check box to assign a fixed single line border to the VB picture box. If you leave this box unchecked, the VB picture box does not have a border [BorderStyle].

•	Auto Size. Select this check box to specify that the VB picture box is automatically resized to fit the area defined for displaying the picture box. If you leave this box unchecked, VB does not automatically resize the VB picture box to fit the defined area [AutoSize].

•	Clip Controls. Select this check box to specify that graphics methods in Paint events (which perform run-time drawing operations) repaint the entire VB picture box. If you leave this box unchecked, VB repaints only newly exposed areas of the picture box so complex forms can be loaded and repainted faster [ClipControls].

Note:	For each ERwin property explained above, the equivalent Visual Basic property is shown in square brackets. Refer to your Visual Basic documentation for more information about a property.


VB Image Style Properties

When you assign the Image style to a column using the Edit Style Editor, ERwin displays the Image Property group box. You can set additional properties for the VB Image control.

The Purpose of each control in the VB Style Property group box is explained below:

•	Border. Select this check box to assign a fixed single line border to the VB image control. If you leave this box unchecked, the VB image control does not have a border [BorderStyle].

Note:	For the ERwin property explained above, the equivalent Visual Basic property is shown in square brackets. Refer to your Visual Basic documentation for more information about a property.


To create or modify a VB edit style

1.	Choose VB Edit Styles from the Client menu to open the VB Edit Style Editor.

•	To modify an existing style, select the style you want to modify in the list and make your changes. To simply rename an existing edit style, click the Rename button. Enter the new name in the Name text box and click the OK button.

•	To create a new edit style, click the New button. Enter the new name in the Edit Style box, select an edit style type, and click the OK button.

2.	To change the type of the selected edit style, click one of the radio buttons in the Edit Style Type group box on the left side of the editor.

•	For each edit style, the ERwin dialog controls provide a subset of the Visual Basic Properties available for the corresponding control. More>>

3.	To use the current edit style (List Box, Combo Box, Check Box or Option Button) to control how a list of valid values is displayed in the client application, choose the validation rule that defines the valid value list from the Validation drop-down list.

4.	When you are done, click the Close button to close the VB Edit Style Editor and return to the diagram window (or the editor from which you opened the VB Edit Style Editor).


Using the VB Display Format Editor

The ERwin Display Format Editor lets you create and modify display formats that allow database column information to be presented in a manner different from the way it is stored. Display formats are frequently used to show numbers as currency values or to show date values in a specific month-day-year format. A display format can be applied to any database column that is assigned an Edit Mask edit style.

A display format is specified by a string of symbols such as MM dd yy, that indicates how the data in the column should be displayed in the client application. See the Format property of the Masked Edit control in your Visual Basic documentation for more information about the allowed display formats.

Note:	In contrast to the input mask, which controls how you enter data in a field, a display format tells Visual Basic how to display the data when the cursor leaves the field.

Related Topics:

  To create or modify a VB display format


To create or modify a VB display format

1.	Choose VB Display Format from the Client menu to open the Display Format Editor.

OR

Click the Format button in the VB Edit Style Editor, which is displayed when the Edit Mask option button is selected.

2.	The list at the top of the Display Format Editor shows all the existing display formats in your ERwin data model.

•	To modify an existing display format, select the display format you want to modify from the list. To simply rename the selected display format, click the Rename button and type the new name in the Name text box of the New Format dialog. Then click the OK button.

•	To create a new display format, click the New button and type the name of the new display format in the Name text box of the New Format dialog. Then click the OK button.

3.	To change the type of the selected display format, choose a Visual Basic format type (string, number, date, time, or date/time) from the Type list.

4.	To change the format of an existing display format or create a new format, type the appropriate string in the Visual Basic Diaplay Format text box in the syntax required by Visual Basic. Refer to your Visual Basic documentation for more information.

5.	When you are done, click the OK button to save your changes.

Note:	Any change you make in the Display Format Editor is temporarily saved in memory when you click the OK button, or switch the focus to another control. Changes are permanently saved to disk when you save the diagram.


Defining VB Validation Rules

The ERwin Validation Rule Editor lets you specify validation rules, which are enforced by the server and restrict what values can be stored in a column. You can also use the Validation Rule Editor to create a similar type of validation rule that restricts what values can be entered in the corresponding data entry control in a Visual Basic client application. Creating a validation rule provides instant feedback if a user enters invalid data in the corresponding data-entry control.

The Validation Rule Editor in the Client menu is identical to the Validation Rule Editor in the Server menu. When you choose Validation Rule from the Client menu, the Visual Basic controls are displayed by default. You can also click on the server tab for server-related options.

The purpose of the validation rule options and controls are described below:

•	Validation Name. This list at the top of the editor displays all the existing validation rules in the ERwin data model.

•	Validation Type. This group box indicates whether the rule is enforced by the client, the server, both, or neither. To specify whether a rule applies to the client and/or the server, click the appropriate check box.

•	Sort By Type. Select this check box if you want to alphabetically sort the validation rules by type. When selected, all client-side (Visual Basic) validation rules are displayed before of any server-side validation rules. By default, the check box is blank and the validation rules are not sorted.

•	Copy. Select this check box if you want to assign the valid value list associated with an existing validation rule to a new validation rule. To assign a valid value list, select the validation rule that you want to use as a source and click the Copy check box. Then, create a new validation rule. ERwin copies the valid values from the source to the new validation rule and creates the appropriate default server expression for the valid values you assigned. See Valid Value below for more information.

•	Client Expression - Visual Basic Validation Rule. This text box works like the <DB Validation Rule> control on the <DB> (Server) tab. To activate this box, make certain that the Client check box in the Validation Type group box is selected. Use the Client Expression control to enter a valid Visual Basic expression for your client validation rule. For example, if you want Visual Basic to check that the value entered in the due_date field is greater than the date entered in the rental_date field, you would enter the expression @due_date > rental_date in the Client Expression text box.

•	Min. / Max. If you want ERwin to automatically generate a validation rule that specifies a minimum value, a maximum value, or a range of values, type the appropriate values in the Min or Max or both text boxes, then click in the Client Expression - Visual Basic Validation Rule text box. ERwin generates the corresponding validation rule in Visual Basic syntax.

•	Valid Value. You can also enter a list of valid values which a Visual Basic application can display as a group of radio buttons, a drop-down list box, etc., depending on the edit style assigned to the column. For example, to display a list of movie categories as a set of radio buttons, click the Valid Values button to open the Valid Values Editor. Enter the list of valid values for the movie categories, and then click OK to return to the Validation Rule Editor.

•	<--Set Expr. Click this button to generate the validation rule from the valid values list and click OK. You can then create a radio button style in the Edit Style Editor and assign the edit style and validation rule to a column to display the valid values as a set of radio buttons. See Using the VB Edit Style Editor for more information.

•	Quote. Select this check box to toggle the quotes on or off in the Client Expression - Visual Basic Validation Rule text box. For example a '10' would become a 10 and vica-versa.

•	NOT. To invert the Visual Basic expression, check the NOT box. ERwin automatically inverts the expression. For example, if the Visual Basic expression is %AttFieldName >= 1 AND %AttFieldName <= 10, and you check the NOT box, ERwin changes the expression to %AttFieldName < 1 OR %AttFieldName > 10.

•	New. Click to open the New Validation dialog. Type a new validation rule name, and click OK.

•	Rename. Click this button to open the Rename dialog. Change the name of the selected validation rule, and click OK.

•	Delete. Click to delete the selected validation name.

•	OK. Closes the Validation Rule Editor and saves your changes.

•	Cancel. Click to close the dialog and cancel any changes.

Related Topics:

  To create or modify a VB validation rule

  Using_the_Validation_Rule_Editor

  Attaching_a_Validation_Rule_to_a_Table


To create or modify a VB validation rule

1.	Choose Validation Rule from the Client menu or the Server menu to open the Validation Rule Editor.

•	To modify an existing validation rule, select the validation rule you want to modify in the list. To simply rename the selected validation rule, click the Rename button, type the new name in the Name text box of the Rename Validation dialog, and click OK.

•	To create a new validation rule, click the New button, type the name of the new validation rule in the Name text box of the New Validation dialog, and click OK.

•	To copy the valid values from an existing rule to a new rule, select the Copy check box and click on the existing rule in the list. Then, click the New button, type the name of the new rule in the Name box of the New Validation dialog, and click OK.

2.	Select the Client check box in the Validation Type group box to enable editing of the Visual Basic client-side validation rule.

3.	Create a client validation rule expression or assign a set of valid values.

•	To enter a client expression, type or edit a Visual Basic validation rule in the Client Expression - Visual Basic Validation Rule text box.

•	To create a list of valid values (or to modify the list), click the Valid Value button. In the Valid Value Editor, enter the list of values and click OK to return to the Validation Rule Editor. More>>

•	Click the <-- Set Expr button to regenerate the Visual Basic rule if necessary.

4.	Click the OK button to save your changes and return to the diagram.


Defining VB Valid Values

Using the ERwin Valid Value Editor you can assign a display value for each valid value so you can control how values appear in the Visual Basic client application. The display values can be used as labels for a set of option buttons or as selectable data items in a combo box.

The purpose of each control on the Valid Value Editor is explained below:

•	Valid Rule. This list displays all existing validation rules.

•	Data Value. This column displays the valid data values you create for the selected validation rule. Data values are values used in Visual Basic expressions. See Defining VB Validation Rules for more information.

•	Display Value. Type a value that Visual Basic displays for the selected ERwin data value. For example, if the value definition is "Recently released videos," you can assign this the display value, "New Releases". This phrase appears as a text label on the Visual Basic form or as one of the choices in the list of valid values.

•	Insert. Select this check box to insert a new data value above the currently selected data value in the Data Value list. If not selected, ERwin places the new data value at the end of the list.

•	Value Definition. Type a definition of the selected data value. This is a free form text box that you can use for any documentation purpose.

•	New. Click to add a new valid value. Type the valid value name in the Name text box of the New Valid Value dialog, and click OK.

•	Rename. Click this button to open the Rename Validation dialog and change the name of the selected validation name.

•	Delete. Click to delete the selected validation name.

•	Sort. Click to alphabetically sort the data values in the Data Value list.

•	OK. Click to close the Validation Rule Editor and save your changes.

•	Cancel. Click to close the dialog and cancels any changes.

Note:  The Valid Values menu option is only enabled if you’ve defined at least one validation rule in the data model.

Related Topics:

  To create or modify VB valid values

  To assign a VB edit style to a valid values list

  Using the Valid Value Editor


To create or modify VB valid values

1.	Choose Valid Values from the Client menu or the Server menu, or click the Valid Values button in the Validation Rule Editor.

2.	Select a validation rule from the Valid Rule list.

3.	Click the New button, type a new valid value name in the New Valid Value dialog, and click OK.

4.	To apply a display value to the data value, complete the Display Value text box.

5.	Opionally, enter a definition for the valid value in the Value Definition text box.

6.	To rename a valid value, click on the data value in the list and click the Rename button. Type the new name in the Rename Valid Value dialog, and click OK.

7.	Click the OK button to save your changes and return to the diagram or previous editor. If you click Cancel, all changes made in the current editing session are discarded.

Note:  The Valid Values menu option is only enabled if you’ve defined at least one validation rule in the data model.


To assign a VB edit style to a valid values list

1.	Choose VB Edit Styles from the Client menu.

2.	Click the New button, type a name for the edit style in the Edit Style text box and click the OK button. You must choose one of the following edit style types in order to apply a valid values list:

•	List Box

•	Combo Box

•	Option Button

•	Check Box

3.	Click on the Validation list and select the validation rule that defines the valid value list.

4.	Choose any additional options available for the selected edit style.

5.	Click OK to save your changes.


Defining VB Client Defaults

You can use the ERwin Default Editor to create a default value that is assigned to a column automatically. Frequently, the most common value stored in a column is assigned as the default value for that column. You can also use the Default Editor to specify a separate default or initial value for your Visual Basic client application.

By defining a separate Visual Basic default, you can insert a default value in the client application that may be different from the default value stored in the column. For example, the default value assigned to the general_condition column might be "New" in the client application and "null" on the server. Or the client-side default value might be derived from the data input for a particular transaction, such as calculating a discount if a customer rents more than one movie or the current date is a weekday.

You can set Visual Basic client defaults by using the Visual Basic-related controls in the ERwin Default Editor. See Using the Database Default Initial Editor for more information.

The purpose of the controls in the ERwin Default Editor are explained below:

•	Default Name. This box at the top of the dialog displays all the existing defaults in the ERwin data model. The left column displays the default names. The right column displays the default type based on whether the default expression is entered in the Server Value and/or Client Value text boxes.

•	Sort By Type. Select this check box if you want to sort the default names by type. If selected, the default names are sorted alphabetically so that all client-side defaults are displayed ahead of any server-side defaults.

•	Client Value. Use this text box to type a Visual Basic initial value or expression for the default. See your Visual Basic documentation for information on the expression syntax.

•	New. Click to add a default name. Type the default name in the New Default dialog, and click OK.

•	Rename. Click this button to open the Rename Default dialog and change the name of the selected validation name.

•	Delete. Click to delete the selected default name.

•	OK. Click to close the Default Editor and save your changes.

•	Cancel. Click to close the dialog and cancels any changes.

Related Topics:

  To create or modify a VB default/initial value


To create or modify a VB default/initial value

1.	Choose Default/Initial from the Client menu or the Server menu to open the Default/Initial Editor.

2.	The list at the top of the Default/Initial Editor displays all the existing defaults in the data model.

•	To create a new default, click the New button, type the name of the new default in the Name text box of the New Default dialog, and click OK.

•	To modify an existing default, select the default you want to modify in the list. To simply rename the selected default, click the Rename button, type the new name in the Name text box of the Rename Default dialog, and click OK.

3.	Type or edit the Visual Basic initial default value or expression in the Client Value text box.

4.	Click OK to save your changes and return to the diagram.


Assigning VB Column Properties to a Domain

By creating an ERwin domain, you can save a set of column properties together under a common name. For example, a domain can include several server-side column properties, such as a datatype, null option, default, and validation rule.

You can also create an ERwin domain to include Visual Basic column properties to make user-interface development easier and faster. For example, you can create a domain named "DATE" that sets the display format, edit style, and initial value for all date values in a client application. You can then assign this domain to all date columns. If necessary, you can use the Column Editor to override one or more of the properties assigned to a column by the DATE domain.

To create or edit a Visual Basic domain, choose Domain from the Edit menu. The ERwin domain editor works like the Column Editor, except that you can view and modify the properties assigned to a domain instead of a physical column. Click the appropriate Visual Basic tab to view or modify VB column properties. You can also click the <DB> tab at the top of the dialog to view or modify server-side column properties.

The controls for domain inheritance and definition work exactly like the standard Domain Dictionary Editor. See Using ERwin Domains for more information.

Related Topics:

  To assign VB properties to a domain

  Creating and Modifying VB Column Properties

  Globally Resetting VB Column Properties


To assign VB properties to a domain

1.	Choose Domain from the Edit menu.

OR

Right-click on a table and choose Column Editor from the shortcut menu. Then select the [image] button from the General tab in the Column Editor.

2.	Click the appropriate Visual Basic tab at the top of the Domain Dictionary Editor to display the Visual Basic client properties. If needed, you can create or modify any domain by using the domain editor. More>>

3.	Choose the Visual Basic column properties to assign to the domain. More>>

4.	If you want to reset all the properties to the default property settings originally defined for the domain, click the Reset button.

5.	Click the OK button to save your changes. If you click Cancel, all changes made in the current editing session are discarded.

Note:	To restore the default properties assigned to a column by its attached domain, use the Reset button in the Target Client dialog. See Globally Resetting VB Column Properties for more information.


Resetting or Migrating VB Column Properties

Resetting VB Column Properties:

In the Visual Basic tab of the Reset Column Property dialog, you can reset column properties and VB Column Properties. See Resetting VB Column Properties for more information.

To open the Reset Column Property dialog, click the Reset button on the Column Editor, the Domain Dictionary Editor, or the Reset Names button on the Target Server dialog.

Migrating VB Column Properties:

In the Visual Basic tab of the Migrate Column Property dialog, you can specify which server-side column property values migrate from a primary key column to foreign key columns. See Migrating VB Column Properties for more information.

To open the Migrate Column Property dialog, click the Migrate button on the Column Editor.

Related Topics

  To migrate VB properties to foreign key columns

  To globally reset VB column properties to their default values

  Resetting VB Column Properties


Migrating VB Column Properties

The Migrate Column Properties dialog lets you choose which Visual Basic properties you want to migrate from the selected primary key column to the related foreign key columns in child entities. To open the Migrate Column Property dialog, click the Migrate button on the Column Editor.

The purpose of each control on the Reset Domain Property dialog is explained below:

•	Edit Style. Select this check box if you want to migrate the edit style.

•	Valid Rule. Select this check box if you want to migrate the validation rule.

•	Initial Value. Select this check box if you want to migrate the initial value.

•	Help ID. Select this check box if you want to migrate the Help ID value.

•	Read Only. Select this check box if you want to migrate the Read Only value.

•	Bitmap. Select this check box to migrate the assigned bitmap.

•	Required. Select this check box to migrate the Required value.

•	Empty is Null. Select this check box to migrate the Empty is Null value.

•	Visible. Select this check box to migrate the Visible value.

•	Tag. Select this check box to migrate the tag text.

•	Font Name. Select this check box if you want to migrate the font type.

•	Font Style. Select this check box if you want to migrate the font style.

•	Font Size. Select this check box if you want to migrate the font size.

•	Foreground. Select this check box if you want to migrate the foreground color.

•	Background. Select this check box if you want to migrate the background color.

•	Label. Select this check box if you want to migrate the label text. Select the Pos check box to migrate the position of the label text.

•	Header. Select this check box if you want to migrate the header text. Select the Pos check box to migrate the position of the label text.

•	Accel. Select this check box if you want to migrate the accelerator key value.

•	Prompt. Select this check box if you want to migrate the prompt text.

•	Select All. Click this button to migrate all column properties in the column to those of the domain.

•	Clear All. Click this button if you do not want to migrate any properties.

•	OK. Click this button to close the dialog and save your changes.

•	Cancel. Click this button to close the dialog and cancel your changes.

Related Topics:

  To migrate VB properties to foreign key columns


To migrate VB properties to foreign key columns

1.	Right-click on a table and choose Column Editor from the shortcut menu.

2.	Select the primary key column in the Column list.

3.	Click the Migrate button.

4.	Click the Visual Basic tab to display a list of the VB column properties that you can migrate.

5.	Select one or more of the VB column property check boxes to indicate which properties you want to migrate from the selected primary key column to the related foreign key columns in child tables. Use the Select All or Clear All button to select or deselect all of the properties collectively.

6.	Click OK.

Note:	Column property migration specified in the Migrate Column Properties dialog is a one-way process; properties are migrated from the parent entity to the child entities. Migration is never done from the child entity to the parent.


Globally Resetting VB Column Properties

By default, each database column in every table of a diagram is automatically assigned a set of column properties by the default ERwin domain. The Reset Domain Property dialog lets you reset both server and client-side column property values to their default values. When you reset VB column properties, you do so for all tables in your data model.

The purpose of each control on the Reset Domain Property dialog is explained below:

•	Edit Style. Select this check box if you want to reset the edit style.

•	Valid Rule. Select this check box if you want to reset the validation rule.

•	Initial Value. Select this check box if you want to reset the initial value.

•	Help ID. Select this check box if you want to reset the Help ID value.

•	Read Only. Select this check box if you want to reset the Read Only value.

•	Bitmap. Select this check box to reset the assigned bitmap.

•	Required. Select this check box to reset the Required value.

•	Empty is Null. Select this check box to reset the Empty is Null value.

•	Visible. Select this check box to reset the Visible value.

•	Tag. Select this check box to reset the tag text.

•	Font Name. Select this check box if you want to reset the font type.

•	Font Style. Select this check box if you want to reset the font style.

•	Font Size. Select this check box if you want to reset the font size.

•	Foreground. Select this check box if you want to reset the foreground color.

•	Background. Select this check box if you want to reset the background color.

•	Label. Select this check box if you want to reset the label text. Select the Pos check box to reset the position of the label text.

•	Header. Select this check box if you want to reset the header text. Select the Pos check box to reset the position of the label text.

•	Accel. Select this check box if you want to reset the accelerator key value.

•	Prompt. Select this check box if you want to reset the prompt text.

•	Select All. Click this button to reset all column properties in the column to those of the domain.

•	Clear All. Click this button if you do not want to reset any properties.

•	OK. Click this button to close the dialog and save your changes.

•	Cancel. Click this button to close the dialog and cancel your changes.

Related Topics:

  To globally reset VB column properties to their default values

  Resetting VB Column Properties


To globally reset VB column properties to their default values

1.	Right-click on the table whose properties you want to reset, and choose Column Editor from the shortcut menu.

2.	Click the Reset button.

3.	Click the Visual Basic tab to display a list of the VB client-side column properties that you can reset.

4.	Click one or more of the check boxes to indicate which properties you want to reset to their default values. Use the Select All or Clear All button to select or deselect all of the properties collectively. Note that you can reset the specific properties for just the currently selected column or for all the columns in the current table.

•	Click the Only column <column_name> option button to reset the checked properties only for the selected column.

•	Click the All columns of table <table_name> option button to reset the checked properties for all the columns in the specified table.

5.	Click OK.


Deleting VB Column Properties

You can delete VB column properties from the same editor you use to create or modify the property. To delete an edit style, display format, VB validation rule, or VB default value, open the appropriate editor (for example, the Column Editor), select the object to delete and click the Delete button. ERwin immediately deletes the object if it is not assigned to any column or domain.

If the Visual Basic column-property is assigned to a column or domain, ERwin displays a confirmation dialog, stating the object’s current assignment and asking if you want to delete it anyway.

Click Yes to delete, or No to cancel the deletion.

If you delete a VB column property that is currently assigned to a column or a domain, the default property setting for the property is applied to the affected column. For example, if you delete an edit style defined as a set of radio buttons, each column and domain that uses that edit style is automatically assigned the default edit style (a single line edit control) in place of the deleted edit style.

Related Topics:

  To delete a VB column property


To delete a VB column property

1.	Open the appropriate ERwin editor (Edit Style Editor, Display Format Editor, Validation Rule Editor, or Default/Initial Value Editor).

2.	Select the VB property you want to delete in the display list at the top of the editor.

3.	Click the Delete button. If ERwin displays a confirmation dialog, answer Yes to confirm the deletion or No to cancel the deletion.

4.	Click OK.


Using ERwin as a VB Data Source

You can use an ERwin data model as a data source for building your Visual Basic application forms and dialogs. If you define both your server and VB column properties in ERwin, you can automatically create VB forms that know how to display the information in each column.

To use ERwin to generate a VB form, you must start ERwin and open the data model you want to use as the data source before you open the ERwin Form Wizard. The ERwin Form Wizard uses the information retrieved from the data model to automatically create the user interface for the VB application.

Related Topics

  Selecting a Target Client

  Resetting VB Column Properties

  How ERwin Generates VB Forms

  Using ERwin with Visual Basic 4.0 or 5.0

  Creating a VB Form

  Creating a Multi-Table VB Form

  Specifying Relationships for a Multi-Table VB Form

  Updating a VB Form


Resetting VB Column Properties

If you have attached a domain to a column, or changed properties in the Column Editor to override specific domain settings, you can easily reset the column properties to the defaults provided by the domain. ERwin provides a high level of precision when resetting column properties -- you can reset only a single property, a group of properties, or all properties for the selected column or table.

When you click the Reset button in the Column Editor, ERwin displays the Reset Column Property dialog. You can reset the properties of the selected column or all columns in the current table by clicking on the appropriate option in the Remove overridden properties for group box. Then, click on the Visual Basic client tab and select the appropriate check boxes in the dialog to indicate the properties to be reset. For example, if you want to reset the Edit Style, click the Edit Style check box. You can click the Select All or Clear All button to select or clear all of the properties collectively.

The purpose of the controls in the Reset Column Properties dialog that are specific to the selected Visual Basic target client are explained below:

•	Edit Style. Select this check box if you want to reset the edit style.

•	Valid Rule. Select this check box if you want to reset the validation rule.

•	Initial Value. Select this check box if you want to reset the initial value.

•	Help ID. Select this check box if you want to reset the Help ID value.

•	Read Only. Select this check box if you want to reset the Read Only value.

•	Bitmap. Select this check box to reset the assigned bitmap.

•	Required. Select this check box to reset the Required value.

•	Empty is Null. Select this check box to reset the Empty is Null value.

•	Visible. Select this check box to reset the Visible value.

•	Tag. Select this check box to reset the tag text.

•	Font Name. Select this check box if you want to reset the font type.

•	Font Style. Select this check box if you want to reset the font style.

•	Font Size. Select this check box if you want to reset the font size.

•	Foreground. Select this check box if you want to reset the foreground color.

•	Background. Select this check box if you want to reset the background color.

•	Label. Select this check box if you want to reset the label text. Select the Pos check box to reset the position of the label text.

•	Header. Select this check box if you want to reset the header text. Select the Pos check box to reset the position of the label text.

•	Accel. Select this check box if you want to reset the accelerator key value.

•	Prompt. Select this check box if you want to reset the prompt text.

•	Select All. Click this button to reset all column properties in the column to those of the domain.

•	Clear All. Click this button if you do not want to reset any properties.

•	OK. Click this button to close the dialog and save your changes.

•	Cancel. Click this button to close the dialog and cancel your changes.

Related Topics

  To reset VB column properties


To reset VB column properties

1.	Choose Target Client from the Client menu to open the Target Client dialog.

2.	Click the Reset button. ERwin displays the Reset Column Property dialog box.

3.	Select the Only column <column name> or the All columns of table <table name> option.

4.	Select the check boxes to indicate which override values should be discarded, or click the Select All or Clear All button to select or deselect all values collectively.

5.	Click OK.


How ERwin Generates VB Forms

An ERwin data model includes all the data source information required to generate a Visual Basic form. To transfer the data source and column display information for a particular form to Visual Basic, ERwin adds a series of dialogs called the ERwin Form Wizard to the Visual Basic design environment.

Using your responses to determine which tables, columns, and relationships to use, the ERwin Form Wizard automatically generates a VB form based on information obtained from the open ERwin data model. When you run the VB form, it reads information from and writes information to the application database (the database in which the application data is stored).

Note:	Visual Basic does not support the full range of referential integrity options generated by ERwin. If you use ERwin to generate your application database, Visual Basic may display an error message if it detects a conflict with an ERwin referential integrity rule. To avoid this problem, clear the referential integrity option in the ERwin Schema Generation Report Options dialog when you generate the application database.

A previous version of ERwin (ERwin for Visual Basic version 2.1), required you to store your data models in the ERwin dictionary in order to generate forms in Visual Basic 3.0. This version does not require dictionary storage to generate Visual Basic forms: the ERwin Form Wizard retrieves the data source and column display information directly from an open data model.

Unlike the previous version, the ERwin Form Wizard in version 2.5 (or higher) cannot access information from the ERwin dictionary. If you want to use an ERwin 2.5 model stored in the dictionary to generate a Visual Basic form, open the model from the dictionary before you start the ERwin Form Wizard so that you can transfer the data source information directly from ERwin to Visual Basic.

The topics below explain how to use the ERwin Form Wizard in Visual Basic to create a data-entry form that displays information from two entities in a sample MOVIES diagram. Once you create the form, you can modify the form's properties or its individual controls with the wide array of features that Visual Basic offers.

Related Topics

  Using ERwin with Visual Basic 4.0 or 5.0

  Creating a VB Form

  Creating a Multi-Table VB Form

  Specifying Relationships for a Multi-Table VB Form

  Updating a VB Form


Using ERwin with Visual Basic 4.0 or 5.0

To use ERwin to generate a Visual Basic 4.0 or 5.0 form requires two steps:

1.	Create a new Visual Basic project and add the required ERwin files.

2.	Use the ERwin Form Wizard to specify the data source for the new form.

Note:	To generate a VB form, you must start ERwin and open the data model you want to use as the data source for the new form before you start the ERwin Form Wizard. See How ERwin Generates VB Forms for more information.


To start Visual Basic 4.0 or 5.0 and create a new project

1.	Start Visual Basic 4.0 or 5.0.

2.	Choose the Add file item from the File menu.

3.	In the Look In (directories) list, choose the native ERwin directory(for example C:\ERWIN3). Double-click on the ERWIN40.BAS code module file in the Files list. Visual Basic adds the file to the list in the Project window.

4.	Repeat steps 2 and 3 above to add the CONST40.BAS file to your project.

Note:	You can avoid having to add the ERWIN40.BAS and CONST40.BAS code files to each new project by adding these files to the AUTO32LD.VBP project.


To start the ERwin Form Wizard in Visual Basic 4.0 or 5.0

1.	Choose ERwin from the VB Add-ins menu.

2.	Choose Form Wizard from the cascade menu.


Creating a VB Form

When you start the ERwin Form Wizard, Visual Basic displays the ERwin Form Wizard dialog. The ERwin Form Wizard dialog lets you specify the source of the data that you want to display in the form.

The ERwin Form Wizard lets you choose an ERwin data model diagram (any model that is currently open in ERwin) as the data source for the VB form. After you choose a diagram, the Form Wizard lets you specify which entities (tables) and which attributes (columns) you want the VB form to access.

The ERwin Form Wizard displays a list of all the models that are currently open in ERwin. Select the ERwin diagram that contains the entities you want to use as the source of the data for the form from the list near the top of the dialog (for example, MOVIES).

Note:	When you are designing a Visual Basic form, you can specify more than one entity as the data source to enable the form to access different database tables. If you select more than one entity as a data source, the ERwin Form Wizard prompts you for additional information it needs to generate the form. See Creating a Multi-Table VB Form for more information.

After you select a diagram, the ERwin Form Wizard immediately displays the name of each entity in the specified data model in the Available Entities list on the lower left side of the dialog. Double-click on each entity that you want to use as a data source for the Visual Basic form.

After you select all the entities for the form, click the Next button on the right side of the dialog. The ERwin Form Wizard then displays the selected entities at the top of the dialog. When you click on one of the entities, the Form Wizard immediately displays the name of each attribute in the selected entity in the Available Attributes list on the lower left side of the dialog. Double-click on each attribute that you want to use as a data source for the Visual Basic form. Selected attributes are displayed in the Selected Attributes list on the lower right side of the dialog.

To select attributes from different entities, first select the entity in the list at the top of the dialog, and then select the attributes you want to include in the form from the Available Attributes list below.

Note:	Instead of double-clicking, you can use the [image] and [image] buttons to add and remove entities or attributes from the Selected list on the bottom of the Form Wizard dialog.

When you are finished selecting all the attributes you want to include on the form, click the Next button. The ERwin Form Wizard displays an Entity Display Style combo box that lets you choose a Presentation Style for each entity.

The supported Presentation styles for Visual Basic 4.0 and 5.0 are: Freeform and DBGrid.

Note:	The FarPoint Grid/VBX control is a third party product. To use the FarPoint Grid/VBX presentation style, you must have the FarPoint Grid/VBX software installed on your computer.

After you choose a Presentation Style for each entity, click the OK button on the right side of the dialog. ERwin displays another Form Wizard dialog that lets you specify information about the new form.

This dialog lets you specify how the form connects to your application database (the database where the real production data is stored) and lets you enter a name and a caption for the form.

There are two ways to specify the connection between the VB form and the application database:

•	If your application database is stored on a SQL database engine (e.g. SQL Server), you must first define an ODBC data source. Then, you enter the ODBC connection string in the Connect box.
For example, in the ODBC connection string:

•	ODBC;DSN=ERVB_APP;UID=baker;PWD=vb2

•	ODBC is an identifier, DSN is the data source name (ERVB_APP), UID is your user name (baker), and PWD is your password (vb2). If you enter ODBC only, Visual Basic prompts you for this connection information when you run your Visual Basic form. Leave the "Database" box blank.

•	If your application database is stored on a desktop database server (e.g., Microsoft Access), you can use the ISAM driver supplied with Visual Basic. In this case, you only need to enter the path name for the application database in the Database box. Leave the Connect box blank.

In addition to specifying the database connection, you must also enter the following VB information about the form:

•	Form Name: Enter the name that Visual Basic uses to reference the form. Do not include spaces.

•	Form Caption: Enter the name that you want to appear in the title bar of the generated form.

Once you complete the dialog and click OK, the ERwin Form Wizard automatically generates the form.

Related Topics:

  To create a VB form


To create a VB form

1.	In Visual Basic 4.0 or 5.0, choose ERwin from the Add-Ins menu, then choose Form Wizard.

2.	In the ERwin Form Wizard, click on the Diagram list, and select the diagram that you want to use as a data source.

3.	After you select a diagram, double-click on one or more entities in the Available Entities list on the left side of the dialog. Selected entities are displayed in the Selected Entities list on the right side of the dialog. If you select more than one entity and then click the Next button, the ERwin Form Wizard asks you to specify which:

•	Child entities to include on the form for each selected parent entity.

•	Relationship to use if a selected entity has more than one relationship to another selected entity.

4.	Click the Next button on the right side of the Form Wizard dialog. ERwin redraws the Form Wizard to show the list of selected entities at the top of the dialog.

5.	To select the attributes you want to display in the form, click on an entity to display its attributes. Double-click on each attribute you want to include on the form.

6.	When you are finished selecting all the attributes you want to include on the form, click the Next button.

7.	ERwin redraws the Form Wizard to show a list of Presentation Styles that can be assigned to an entity in the list below the Entities box.

8.	To assign a Presentation Style to an entity, first click on the entity in the Entities box to select it. Then, click on the Entity Display Style combo box and choose a Presentation Style from the list displayed. Choose Free-form to display only one row at a time from the corresponding database table. Choose DBGrid (Visual Basic 4.0), to display multiple data rows from the corresponding table in a spreadsheet-like grid control. Repeat this process for each entity you want to include in the form.

9.	When you are finished assigning Presentation Styles to entities, click OK to display the Form Wizard dialog so you can enter database connection information for the form.

10.	In the Form Wizard dialog, type an ODBC connection string in the Connect box if you want to connect your form to a SQL database (e.g., SQL Server), or type the complete pathname of the database in the Database box if you want to connect your form to a desktop database (for example, Microsoft ACCESS). Also, enter the form name and a caption. Visual Basic generates an error if you specify a name that already exists in your Visual Basic project.

Note:	Visual Basic generates an error if it detects a form name that contains spaces. Enter a form name with no embedded spaces.

11.	When you complete the final Form Wizard dialog, click OK. ERwin automatically generates the form and adds it to your Visual Basic project.

Note:	The Timer control that appears on the generated form in Design mode is used to check the initialization/loading status when the form is run. Do not delete this control (it is hidden at runtime). While the form is loading, the text cursor is not available and you cannot enter or modify data.


Creating a Multi-Table VB Form

You can use the ERwin Form Wizard to specify more than one entity as the data source for a Visual Basic form. In this way, the VB form can access data from two or more different database tables. This makes it easy to create sophisticated master-detail layouts where one table provides a master data record such as invoice header information and another table provides the invoice detail information for each line item ordered on the invoice.

You can use ERwin to specify any number of entities in the data source for a form. For example, you could use a sample MOVIES model to create a form that shows an actor (master record) and the movies in which that actor appears (detail information). In this example, the ACTOR entity is assigned the Free-form Presentation style and the MOVIE entity is assigned the Grid style.

Note:	The ACTOR entity is used as an example only, it is not included in the sample MOVIES diagram.

Related Topics:

  Specifying Relationships for a Multi-Table VB Form

  To create a multi-table VB form


Specifying Relationships for a Multi-Table VB Form

Although you can display any group of entities together on the same form, in order to display meaningful data from multiple tables, there must be a relationship between the tables (it wouldn't make sense to show the actors that are not associated with the movie). If you include more than one entity in the data source for a form, the ERwin Form Wizard automatically prompts you for the relationship information it requires to create the form. For any set of related entities that you want to display on the form, ERwin needs to know which is the parent entity and which are the child entities.

When you finish selecting the entities you want to include on the form and click the Next button, each selected entity that is a parent of another selected entity is automatically displayed in the Parent Entities list at the top of the Form Wizard dialog. The available child entities for each parent are displayed in the Available Child Entities list on the lower left side of the dialog. To specify which relationship you want your VB form to reflect, first select a parent entity in the top list and then double-click on a child entity in the Available Child Entities list. The child entity you select is displayed in the Selected Child Entities list in the lower right side of the dialog.

Note:	The ERwin Form Wizard does not currently support a recursive relationship (a relationship in which the same entity is both the parent and the child).

If a selected entity has more than one relationship with another selected entity, the ERwin Form Wizard needs to know which relationship you want to represent on the form. For example, there might be several relationships between the ACTOR entity and the MOVIE entity (e.g., stars in, directs, produces, won Oscar for role in, etc.).

If you select both the ACTOR and MOVIE entities to appear on the form, the ERwin Form Wizard asks you to specify which relationship(s) you want to depict on the form. In the Form Wizard, the Parent/Child entity pairs are listed at the top of the dialog and the Relationships between each pair of entities are listed below. To specify the relationship you want to represent on the form, first select an entity pair, then click on the relationship you want to use in the form.

To show more than one relationship between a single pair of entities, select one of the entities twice to create a clone entity in the Selected Entity list. When you select an entity more than once, ERwin automatically appends a number to the entity name to uniquely identify each clone.

When you specify the relationship(s) to show in the form, you can select a different relationship for each cloned entity. For example, if you want to show all the movies that a given actor stars in as well as all the movies he/she directed, you can assign the stars-in relationship to the ACTOR-MOVIE pair and the directs relationship to the ACTOR-MOVIE-1 pair.

The generated form would show both of these relationships.

Note:	When you create a clone entity in the Form Wizard, it automatically inherits all the relationships of the real source entity.

Related Topics

  To create a multi-table VB form

  Specifying Relationships for a Multi-Table VB Form


To create a multi-table VB form

1.	In Visual Basic 4.0 or 5.0, choose ERwin from the Add-Ins menu, and then choose Form Wizard from the cascade menu.

2.	In the ERwin Form Wizard, select the diagram that you want to use as a data source from the list at the top of the dialog.

3.	After you select a diagram, double-click on one or more entities in the Available Entities list on the left side of the dialog. Selected entities are displayed in the Selected Entities list on the right side of the dialog.

4.	Click the Next button. If you select an entity that has a relationship with one or more selected entities, ERwin redraws the Form Wizard to show a list of the selected parent entities. Click on an entity in the Parent Entities list, then double-click on one or more child entities in the Available Child list. Selected child entities are displayed in the Selected Child Entities list on the right side of the dialog.

5.	Click the Next button. If any of the entities you selected has more than one relationship with another selected entity, ERwin redraws the Form Wizard to show a list of parent/child entity pairs. Click on an  entity pair in the Parent/Child Entity Pairs list, then choose a relationship from the Selected Relationship drop-down box. Repeat this process for each parent/child entity pair.

6.	When you are finished selecting a relationship for each parent/child entity pair, click the Next button on the right side of the Form Wizard dialog. ERwin redraws the Form Wizard to show the list of selected entities at the top of the dialog. The attributes available in each entity are displayed in the Available Attributes list below.

7.	To select the attributes you want to display in the form, click on an entity to display its attributes. Double-click on each attribute you want to include on the form. Selected attributes are displayed in the Selected Attributes list on the right of the Form Wizard dialog.

8.	When you are finished selecting all the attributes you want to include on the form, click the Next button. ERwin redraws the Form Wizard to show a list of Presentation Styles that can be assigned to an entity in the list below the Entities box.

9.	To assign a Presentation Style to an entity, first click on the entity in the Entities box to select it. Then, click on the down arrow in the Entity Display Style combo box and choose a Presentation Style from the list displayed. Choose Free-form to display only one row at a time from the corresponding database table. Choose DBGrid to display multiple data rows from the corresponding table in a spreadsheet-like grid control. Repeat this process for each entity you want to include in the form.

10.	When you are finished assigning Presentation Styles to entities, click OK to display a Form Wizard dialog that lets you enter database connection information for the form.

11.	In the Form Wizard dialog, type an ODBC connection string in the Connection box if you want to connect your form to a SQL database (e.g., SQL Server), or type the complete pathname of the database in the Database box if you want to connect your form to a desktop database (for example, Microsoft ACCESS). Also, enter the form name and a caption. Visual Basic generates an error if you specify a name that already exists in your Visual Basic project.

Note:	Visual Basic generates an error if it detects a form name that contains spaces. Enter a form name with no embedded spaces.

12.	When you complete the final Form Wizard dialog, click OK. ERwin automatically generates the form and adds it to your Visual Basic project.

Note:	The Timer control that appears on the generated form in Design mode is used to check the initialization/loading status when the form is run. Do not delete this control (it is hidden at runtime). While the form is loading, the text cursor is not available and you cannot enter or modify data.


Updating a VB Form

You can reposition or resize a control on a form created by the ERwin Form Wizard by selecting and dragging the control or its borders. You can also use the Visual Basic Property window to modify the properties of individual controls.

Note:	ERwin does not retain changes made to a form in Visual Basic. If you modify the properties of the controls in a form created by ERwin using the Visual Basic Properties window, your modifications are overwritten when you update the form using the ERwin Form Wizard.

Related Topics:

  To recreate a form after modifying the ERwin data model


To recreate a VB form after modifying the ERwin data model

1.	Open the Visual Basic project that contains the form you want to update.

2.	In the Visual Basic Project window, click on the form file, then choose Remove File from the File menu.

3.	In Visual Basic 4.0 or 5.0, choose ERwin from the Add-Ins menu, and then choose Form Wizard.

4.	Use the ERwin Form Wizard to select the entities and attributes that you want to include on your Visual Basic form. More>>.

5.	When Visual Basic displays the dialog prompting you for information about the form, enter the form information you entered before. The ERwin Form Wizard generates the new form and automatically adds it to your project. Double-click on the form file in the Project window to display the form which contains the modifications.

Note:	ERwin does not retain changes made to a form in Visual Basic. If you modify the properties of the controls in a form created by ERwin using the Visual Basic Properties window, your modifications are overwritten when you regenerate the form using the ERwin Form Wizard.


Using the ERwin Dictionary

ERwin lets you save an ERwin diagram in the ERwin Dictionary, a special database that you can generate on your target server, to support check-in/check-out version control and diagram sharing. You can create the ERwin Dictionary on any target servers supported by ERwin, simply by generating the Dictionary metamodel to the target server of your choice.

The ERwin metamodel defines the data structures needed to store all the definition, location, font, color, and other required information about the entities, tables, views, attributes, columns, and relationships and other objects in your ERwin diagrams.

This metamodel is defined in the ERWMETA.ER1 file installed in the ERwin program directory, and it provides the internal definition information that ERwin requires to generate the ERwin Dictionary as a physical database on the target server. After the model is generated, you can use ERwin’s Dictionary Manager features to save your diagrams to this database.

If you need stronger support for and control of a multiuser environment, Logic Works provides the ModelMart, which supports diagram locking, circulation of multiple diagram versions for team design environments, and an automatic method for merging differences found in multiple versions.

Note:	If you would like more detailed information on the ERwin metamodel structures and valid values, see “ERwin Metamodel Entities and Attributes” in the ERwin Reference Guide.

The following databases cannot be used to store the ERwin Dictionary: AS/400, Ingres/OpenIngres, Interbase, Paradox, Rdb, and Red Brick.

Related Topics

  Using the ERwin Metamodel to Generate the ERwin Dictionary

  Using the Dictionary Manager

  Storing a Diagram in the ERwin Dictionary

  Opening a Diagram Stored in the ERwin Dictionary

  Working with Multiple Versions of a Diagram


Using the ERwin Metamodel to Generate the ERwin Dictionary

To store an ERwin diagram on a target server, you must create an ERwin Dictionary. To create the dictionary, you simply generate the ERwin metamodel schema to your target server.

The information in the ERwin Dictionary Metamodel is divided into the following subject areas:

•	Main Subject Area. Includes all the tables in the metamodel.

•	Schema. Includes just the tables that are required to create the ERwin Dictionary on a target server. When you generate a schema from the metamodel, you must make the Schema subject area the current subject area.

•	Relevant. Includes several entities that are not in the Schema subject area and are not generated when you create the Dictionary, but contain information that is helpful for understanding the whole metamodel.

•	Text-Related. Contains entities that store lengthy text values such as entity descriptions, notes, etc.

If you use ODBC or direct connection to the system catalog to access your target server, the Dictionary database that is generated from the ERwin metamodel appears as a set of tables in the server database which can store multiple diagrams and versions of those diagrams.

If you are using dBASE, FoxPro, or Clipper target servers and use direct connection instead of an ODBC data source to access the server, the Dictionary is generated as a set of .DBF files, which can store a single version of a single diagram only.

Note:	If your target server is uses ODBC connection, or if you want to use ODBC to connect to your Clipper, Foxpro, or dBASE target server, you need to create an empty database file in which to store the Dictionary and configure ODBC drivers on your machine before you generate the ERwin Dictionary. See Defining ODBC Data Sources for more information.

Related Topics

  To generate the ERwin Dictionary schema to a SQL database

  To generate the ERwin Dictionary schema to an ODBC data source

  To generate the ERwin Dictionary schema to DBF files


To generate the ERwin Dictionary schema to a SQL database

 1.	Click [image].

 2.	Switch to the directory in which you installed the ERwin program files and double-click on the filename of the metamodel (ERWMETA.ER1) to open the ERwin metamodel. ERwin displays a message indicating that the file is read-only.

 3.	Click OK.

 4.	Select Target Server on the Server menu.

 5.	Click a Target SQL DBMS option button to select the SQL DBMS you want to use to store your ERwin diagrams and then click OK. ERwin prompts you to convert the datatypes to those supported on the selected target server.

 6.	Make sure that the Convert Domain Datatypes check box is selected and click Yes.

 7.	Click [image] and select Schema from the list of subject areas.

 8.	Select Forward Engineering/Schema Generation on the Tasks menu.

 9.	Select the default Schema Generation Report in the Report list box.

 10.	Click the Generate button.

 11.	If you are not already logged on to the target server, ERwin displays the <Database> Connection dialog. Log on to the target server. More>

 12.	ERwin opens the Generate Database Schema dialog and displays the schema DDL script as it is executed. After the schema is generated, choose one or more of the following actions:

 ♦	To save the message log to a file, click [image].

 ♦	To print the message log to the default printer, click [image].

 ♦	To view or search the message log, use the [image] (Find) button or the scroll bar to navigate through the displayed message log.

 ♦	To close the message log, click OK.

 13.	Click Close to close the Schema Generation Report Editor.

Note:	To cancel generation of the ERwin Dictionary, click Abort. If the execution of a statement fails, ERwin displays an error message in the message log. Click Abort to cancel generation or click Continue to execute the next schema statement. If a statement fails during generation of the ERwin Dictionary, verify that the Dictionary does not already exist in the selected target server and that you have permission to create tables in the selected target server.

If you need to regenerate the ERwin metamodel schema in the same database, you can use the above procedure; however, be sure to select the Drop Table check box (along with Create Table and Table Post Script) in the Schema Generation Report Editor. When the Drop Table option is checked, all the existing tables referenced in the schema are deleted before ERwin generates new tables. If you drop the ERwin metamodel tables when you regenerate the schema, all the information about exported diagrams stored on the server is deleted when the old schema tables are dropped.


To generate the ERwin Dictionary schema to an ODBC data source

 1.	Choose one of the following options:

•	To generate a schema to a desktop database using ODBC, define an ODBC data source in Windows 3.11, Windows NT, or Windows 95. More>

•	To generate a schema to a SQL database using ODBC, define the ODBC data source. More>

 2.	Open ERwin.

 3.	Click [image].

 4.	Switch to the directory in which you installed the ERwin program files and double-click on the filename of the metamodel (ERWMETA.ER1) to open the ERwin metamodel. ERwin displays a message indicating that the file is read-only.

 5.	Click OK.

 6.	Select Target Server on the Server menu.

 7.	Select the same database that you specified as your ODBC data source in Step 1 in the Target Desktop DBMS group box, and then click OK. ERwin prompts you to convert the datatypes to those supported on the selected target server.

 8.	Make sure that the Convert Domain Datatypes check box is selected and click Yes.

 9.	Click [image] and select Schema from the list of subject areas.

 10.	Select Forward Engineering/Schema Generation on the Tasks menu.

 11.	Select the default Schema Generation Report in the Report list box.

 12.	Click the Generate button. ERwin displays the <Database> Connection dialog.

 13.	Enter your user name, password (if required for the ODBC data source), and the path and file name of your database, then click Connect.

 14.	ERwin opens the Generate Database Schema dialog and displays the schema DDL script as it is executed. After the schema is generated, choose one or more of the following actions:

 ♦	To save the message log to a file, click [image].

 ♦	To print the message log to the default printer, click [image].

 ♦	To view or search the message log, use the [image] (Find) button or the scroll bar to navigate through the displayed message log.

 ♦	To close the message log, click OK.

 15.	Click Close to close the Schema Generation Report Editor.

Note:	To cancel generation of the ERwin Dictionary, click Abort. If the execution of a statement fails, ERwin displays an error message in the message log. Click Abort to cancel generation or click Continue to execute the next schema statement. If a statement fails during generation of the ERwin Dictionary, verify that the Dictionary does not already exist in the selected target server and that you have permission to create tables in the selected target server.

If you need to regenerate the ERwin metamodel schema in the same database, you can use the above procedure; however, be sure to select the Drop Table or Delete Table check box (along with Create Table and Table Post Script) in the Schema Generation Report Editor. When this option is checked, all the existing tables referenced in the schema are deleted before ERwin generates new tables. If you drop the ERwin metamodel tables when you regenerate the schema, all the information about exported diagrams stored on the server is deleted when the old schema tables are dropped.


To generate the ERwin Dictionary schema to DBF files

1.	Click [image].

2.	Switch to the directory in which you installed the ERwin program files and double-click on the filename of the metamodel (ERWMETA.ER1) to open the ERwin metamodel. ERwin displays a message indicating that the file is read-only.

3.	Click OK.

4.	Select Target Server on the Server menu.

5.	Select your target database in the Target Desktop DBMS group box, and then click OK. ERwin prompts you to convert the datatypes to those supported on the selected target server.

6.	Make sure that the Convert Domain Datatypes check box is selected and click Yes.

7.	Click [image] and select Schema from the list of subject areas.

8.	Select Forward Engineering/Schema Generation on the Tasks menu.

9.	Select the default Schema Generation Report in the Report list box.

10.	Click the Generate button.

11.	Select the path and directory name in which you want to save the .DBF files that comprise the ERwin Dictionary, then click OK.

12.	ERwin opens the Generate Database Schema dialog and displays the schema DDL script as it is executed. After the schema is generated, choose one or more of the following actions:

•	To save the message log to a file, click [image].

•	To print the message log to the default printer, click [image].

•	To view or search the message log, use the [image] (Find) button or the scroll bar to navigate through the displayed message log.

•	To close the message log, click OK.

13.	Click Close to close the Schema Generation Report Editor.

Note:	To cancel generation of the ERwin Dictionary, click Abort. If the execution of a statement fails, ERwin displays an error message in the message log. Click Abort to cancel generation or click Continue to execute the next schema statement.

If you need to regenerate the ERwin metamodel schema in the same directory, you can use the above procedure. Select the Drop Table check box (along with Create Table and Table Post Script) in the Schema Generation Report Editor to overwrite the existing .DBF files with the new files. If you overwrite the ERwin metamodel tables during schema generation, the diagram previously stored on the target server is deleted.


Using the Dictionary Manager

After you generate the ERwin Dictionary schema to your target server, you can begin storing ERwin diagrams in that database. To save a diagram and store it on the target server, you must use the Dictionary Manager option on the File menu, instead of the Save or Save As options.

When you store diagrams on a server, ERwin uses a check-in/check-out system that helps you prevent multiple users from making changes to a diagram at the same time. This provides a means of version control by treating the diagram as if it were being checked into a library. When you check in a diagram, you can save it with a new name or overwrite a copy that is already stored on the server. When you check out a diagram from the server, ERwin records the check out status of the diagram, listing you as its current user.

•	If you want to check in the diagram under a new name, just enter the name in the Diagram Name text box and click the Check-in button to start the export.

•	If you check in an updated version of a diagram that you previously checked out, your server logon name appears as the Current User of the diagram in the list box at the top of the Dictionary Manager dialog. Click the diagram name in the list box and then click the Check-in button. ERwin saves the diagram file on the server with a new version number.

The purpose of each control in the Dictionary Manager is explained below:

•	Diagram Name/Ver (list box). Displays a list of all the ERwin diagrams stored in the target database, the diagram version number, the name of the current user of each diagram, the most recent modification date, and the number of entities in the diagram when it was last checked out. This control is unavailable for Clipper, dBASE, and FoxPro, unless you use an ODBC connection.

•	Diagram Name (text box). Enter a name for the active ERwin diagram. This control is used with the Check In button to store a new diagram in the Dictionary. This control is unavailable for Clipper, dBASE, and FoxPro, unless you use an ODBC connection.

•	Dictionary Connection Information. Displays user logon information in read-only format.

•	Close. Closes the dialog and saves your changes.

•	Check-in. Click this button to open the Check-in Diagram dialog and save the active ERwin diagram to the ERwin dictionary. This control is available when the active diagram:

•	Is stored in the Dictionary and was checked out of the Dictionary during the current modeling session.

•	Has not been stored in the Dictionary, but a name has been entered for it in the Diagram Name text box.

•	Check-out. Click this button to display the Check-out Diagram dialog and open the selected diagram version in ERwin.

•	History. Click this button to open the Version History dialog and view or update information on all versions of the selected diagram. This control is unavailable for Clipper, dBASE, and FoxPro, unless you use an ODBC connection.

•	Delete. Deletes the selected diagram version. This control is unavailable for Clipper, dBASE, and FoxPro, unless you use an ODBC connection.

•	Connect. Click this button to open the <Database> Connection dialog and log on to a different ERwin Dictionary.

•	Disconnect. Click this button to log out of the current ERwin Dictionary.

Related Topics

  Selecting the Target Server That Contains the ERwin Dictionary

  Storing a Diagram in the ERwin Dictionary

  Opening a Diagram Stored in the ERwin Dictionary

  Working With Multiple Versions of a Diagram

  Using the ERwin Metamodel to Generate the ERwin Dictionary


Storing a Diagram in the ERwin Dictionary

The Check-in Diagram dialog is used to store a diagram version in the ERwin Dictionary on your target server. When you click the Check-in button in the Dictionary Manager dialog, ERwin displays the Check-in Diagram dialog.

When you check a diagram into the ERwin Dictionary Manager, ERwin translates the information in the active diagram into SQL INSERT, UPDATE, and DELETE statements and adds the new diagram information into the ERwin Dictionary tables on the target server. For Clipper, dBASE, and FoxPro databases that you have accessed directly (instead of through ODBC), the Dictionary Manager adds the information in the diagram into the ERwin Dictionary .DBF tables.

The purpose of each control on the Check-in Diagram dialog is explained below:

•	Diagram Name. Displays the name of the diagram that was selected in the Dictionary Manager for check in.

•	User Name. Displays the server logon name of the current user.

•	Check-in Notes. Enter information about the version of the diagram that was selected in the Dictionary Manager for check in. This control is unavailable for Clipper, dBASE, and FoxPro, unless you use an ODBC connection.

•	Flatten Inheritance. Select this check box to store column values inherited from a domain with each column definition. This option simplifies the way domain values are associated with physical columns. When the Flatten Inheritance option is enabled, ERwin stores inherited domain values with each column definition instead of using references to trace inherited domain information from ancestor objects.

•	Version. Displays the ERwin-generated version number for the selected diagram. ERwin assigns version numbers sequentially, starting at the number 1. Each time you check a diagram into the dictionary, ERwin increments the version number for that diagram. You can enter a different version number for the selected diagram in the text box. This control is unavailable for Clipper, dBASE, and FoxPro unless you use an ODBC connection.

•	Check-in. Saves the selected diagram in the ERwin Dictionary on your target server.

•	Cancel. Closes the dialog and cancels any changes.

Note:	Unless you use an ODBC connection, you can save one diagram at a time in an ERwin dictionary created for Clipper, dBASE, or FoxPro target servers. On all other servers, you can store multiple diagrams and versions in the ERwin Dictionary.

In order to check in or check out a diagram stored on a SQL database server, you need UPDATE permission on the ERwin Diagram table, ERW_DIAG, and SELECT permission on all of the ERwin Dictionary tables.

Related Topics

  To store a diagram in the ERwin Dictionary

  Using the Dictionary Manager

  Opening a Diagram Stored in the ERwin Dictionary

  Working With Multiple Versions of a Diagram


To store a diagram in the ERwin Dictionary

1.	Open the diagram that you want to store in the ERwin Dictionary.

2.	Choose Dictionary Manager on the File menu.

3.	Click a Target DBMS option button to select the SQL or Desktop DBMS in which you want to store your ERwin diagrams and then click OK.

4.	Log on to the target server. More>

5.	Choose one of the following options: (These options are not available for Clipper, dBASE, and FoxPro target servers, unless you use an ODBC connection.)

•	To store the active diagram under a new name, enter the name in the Diagram Name text box.

•	To update a version of a diagram that you previously checked out, click the diagram name in the list box.

6.	Click Check-in.

7.	When ERwin displays the Check-in Diagram dialog, choose one or more of the following options:

•	To enter descriptive information about this version of the diagram, type the description in the Check-in Notes text box. This option is not available for Clipper, dBASE, and FoxPro target servers, unless you use an ODBC connection.

•	To modify the version number, type a new number in the Version text box. This option is not available for Clipper, dBASE, and FoxPro target servers, unless you use an ODBC connection.

•	To store values inherited from a domain with the column definition information, choose the Flatten Inheritance option.

8.	Click Check-in to start checking in the diagram. After ERwin copies the diagram into the dictionary, it displays a message to indicate the diagram check in was successful.

9.	Click OK.

Note:	Unless you use an ODBC connection, you can only save one diagram at a time in an ERwin dictionary created for Clipper, dBASE, or FoxPro target servers. If you are using Clipper, dBASE, or FoxPro and choose a directory that contains ERwin Dictionary .DBF files, ERwin overwrites the information in these files with the updated diagram information.


Opening a Diagram Stored in the ERwin Dictionary

The Check-out Diagram dialog lets you open diagrams that are stored in the ERwin Dictionary on your target server. To open a diagram stored in the ERwin Dictionary, click the Check-out button in the Dictionary Manager.

The purpose of each control on the Check-out Diagram dialog is explained below.

•	Check-out. Opens the selected diagram in ERwin and updates the check-in/check-out information in the ERwin Dictionary to show that the diagram is checked out.

•	Cancel. Closes the dialog and cancels any changes.

•	Read Only. Select this check box if you want to open the diagram in ERwin, but you do not want to save any changes to the diagram back to the ERwin Dictionary. Clear this check box if you want to check out the diagram for update. This control is unavailable for Clipper, dBASE, and FoxPro unless you use an ODBC connection.

When you check out a diagram from the ERwin Dictionary, ERwin records the check-out status of the diagram, listing your server logon name as the diagram’s current user. ERwin then retrieves the selected diagram information from the ERwin Dictionary tables on the selected target server and displays the information as an ERwin diagram.

If you check out a diagram in Read/Write mode and the diagram is currently checked out in the same mode by another user, ERwin displays the Diagram Check-out Warning dialog. You can override this warning and choose to continue by clicking Yes, or cancel and return to the Dictionary Manager by clicking No.

If you click Yes, ERwin automatically selects the Read Only check box to prevent you from changing the diagram while it is being updated by another user. You can clear this check box if you want to open the diagram in Read/Write mode, even though your changes or those of another user may be overwritten.

Note:	In order to check in or check out a diagram stored on a SQL database server, you need UPDATE permission on the ERwin Diagram table, ERW_DIAG, and SELECT permission on all of the ERwin Dictionary tables.

Related Topics

  To open a diagram stored in the ERwin Dictionary

  Using the Dictionary Manager

  Storing a Diagram in the ERwin Dictionary

  Working With Multiple Versions of a Diagram


To open a diagram stored in the ERwin Dictionary

1.	Choose Dictionary Manager on the File menu.

2.	Click a Target DBMS option button to select the SQL or Desktop DBMS in which your ERwin diagrams are stored and then click OK.

3.	Log on to the target server. More>

4.	Click on the name of the diagram in the Dictionary Manager list that you want to check out of the dictionary. This option is not available for Clipper, dBASE, and FoxPro target servers, unless you use an ODBC connection.

5.	Click Check-out.

6.	Choose one or more of the following options: (These options are not available for Clipper, dBASE, and FoxPro target servers, unless you use an ODBC connection.)

•	To check out a diagram for viewing only, select the Read Only check box.

•	To check out a diagram in Read/Write mode so you can make changes to it, clear the Read Only check box.

7.	Click Check-out. If the diagram is checked out in Read/Write mode, ERwin updates the current user name in the ERwin Dictionary.

8.	If the diagram is currently checked out in Read/Write mode by another user and you have also selected Read/Write mode, ERwin displays the Diagram Check-out Warning dialog. Click Yes to continue the check-out process. ERwin automatically sets your version to read-only mode.

9.	Click OK.

Note:	If you override the Diagram Check-out Warning, ERwin automatically sets your version to read-only mode. You can, however, override this safety feature and check out the diagram in Read/Write mode. In this situation, someone must manually reconcile changes made to the different versions.


Working With Multiple Versions of a Diagram

You can store multiple versions of a diagram in the ERwin Dictionary to track changes made to the model over a period of time. The ERwin Dictionary provides support for controlling and managing multiple diagram versions and multiuser access through diagram versioning and check-in/check-out facilities.

If you need stronger support for and control of a multiuser environment, Logic Works provides the ModelMart, which supports diagram locking, circulation of multiple diagram versions for team design environments, and an automatic method for merging differences found in multiple versions. See Using ERwin as a ModelMart Client for more information.

The diagram versioning supported by the ERwin Dictionary uses a version number, which is assigned to a diagram each time you check it into the Dictionary. The version number is displayed in the Dictionary Manager list box, and in the upper right corner of the Check-in Diagram dialog.

ERwin assigns version numbers sequentially, starting at the number 1. Each time you check a diagram into the dictionary, ERwin increments the version number for that diagram. You can enter a different version number for the selected diagram in the text box, if you want to change it to a different number. ERwin also lets you add detailed notes to each version, which can be used to describe special features and identify how a particular version varies from the previous version.

The Dictionary Manager displays only the most recent version of a particular diagram. If you want to view all previous versions of a diagram, you can click the History button in this dialog to display the Version History dialog.

Note:	The version control feature of the ERwin Dictionary is unavailable for Clipper, dBASE, and FoxPro, unless you use an ODBC connection.

Related Topics

  Using the Version History Dialog

  Using the ERwin Dictionary


Using the Version History Dialog

The Version History dialog lets you view a list of all previous versions of a diagram that were saved to the ERwin Dictionary. Using the Version History dialog, you can also check out a version in read-only mode, view and modify the notes associated each diagram version, and delete specific diagram versions from the Dictionary.

To view or update a diagram version history in the ERwin Dictionary, select a diagram in the Dictionary Manager list box, then click the History button.

The purpose of each control in the Version History dialog is explained below:

•	Diagram Name. Displays the name of the diagram selected in the Dictionary Manager dialog.

•	Version. Lists the versions of the selected diagram stored in the ERwin Dictionary, in numeric order.

•	Check-in Date. Displays the date that the diagram version was checked into the Dictionary.

•	Check-in User. Displays the server logon name of the user who checked the diagram version into the Dictionary.

•	Current User. Displays the server logon name of the user (if any) who currently has the diagram checked-out of the Dictionary.

•	Check-in Notes. Displays the check-in notes for the selected diagram. You can edit the text in this text box and click the Update Notes button to save your changes to the notes in the ERwin Dictionary.

•	Close. Closes the dialog and saves your changes.

•	Extract. Opens the selected diagram version in ERwin in read-only mode.

•	Update Notes. Writes any changes you made in the Check-in Notes text box to the ERwin Dictionary for the selected diagram version.

•	Delete. Deletes the selected diagram version.

Note:	The version control feature of the ERwin Dictionary is unavailable for Clipper, dBASE, and FoxPro unless you use an ODBC connection.

Related Topics

  To view or update a diagram version history in the ERwin dictionary

  Using the Dictionary Manager

  Working with Multiple Versions of a Diagram


To view or update a diagram version history in the ERwin dictionary

1.	Choose Dictionary Manager on the File menu.

2.	Click a Target DBMS option button to select the SQL or Desktop DBMS in which your ERwin diagrams are stored and then click OK.

3.	Log on to the target server. More>

4.	Select the name of the diagram in the Dictionary Manager list box, then click History. ERwin displays the Version History dialog.

5.	Click on the version of the diagram whose history you want to view or modify.

6.	Choose one or more of the following options:

•	To check out the selected version in read-only mode, click Extract.

•	To update the Check-in Notes, type the new information in the text box and click Update Notes.

•	To delete the selected version from the target server, click Delete.

7.	Click Close.

Note:	The version control feature of the ERwin Dictionary is unavailable for Clipper, dBASE, and FoxPro, unless you use an ODBC connection.


Selecting the Target Server that Contains the ERwin Dictionary

In order to access the ERwin Dictionary, you must specify both the location and target server in which it resides. When you choose ERwin Dictionary on the File menu, ERwin displays the Target Dictionary Storage DBMS dialog.

The purpose of each control on the Target Dictionary Storage DBMS dialog is explained below:

•	Target SQL DBMS or Target Desktop DBMS. Click the option button next to the target server that contains the ERwin Dictionary.

•	<Database> Version. Select the version of the target SQL or desktop DBMS from the list provided.

•	OK. Opens the <Database> Connection dialog so that you can log on to the Dictionary Manager.

•	Cancel. Closes the dialog and cancels access to the Dictionary Manager.

Related Topics

  To open a diagram stored in the ERwin Dictionary

  Using the Dictionary Manager

  Storing a Diagram in the ERwin Dictionary

  Working With Multiple Versions of a Diagram


Forward and Reverse Engineering

The process of generating the physical database schema from the logical data model is called forward engineering. When you generate a physical schema, ERwin lets you include tables, triggers, and stored procedures, as well as index, constraint, physical storage, and other database features supported by the target DBMS.

Similarly, the process of generating a data model in ERwin from a physical database is called reverse engineering. You can quickly create a data model by reverse engineering an existing database. After you’ve created an ERwin model, you can reengineer or update the data structure and easily migrate it to another database format.

ERwin also lets you update your physical database schema to reflect changes to the model and update the model to capture changes made directly to the database. This synchronization process captures differences between an ERwin data model and a physical database, schema script file, ModelMart diagram, or a different ERwin model. The resulting list of changes can be used to update the open ERwin data model, the database, or both.

Whether you’re moving information from ERwin to a server or vice-versa, ERwin’s direct connection or ODBC connection to the target server’s system catalog lets you easily synchronize the data model and the physical schema throughout the full development cycle.

Related Topics

  Forward Engineering/Generating a Database Schema

  Reverse Engineering from a DDL Script or Database

  Synchronizing Data Models, Scripts, and Databases

  Updating an ERwin Model Using Synchronization

  Altering a Database Using Synchronization

  Using Complete Compare

  Generating a Comparison Report


The Tasks Menu

ERwin provides a suite of features under the Tasks menu option that let you generate and maintain a target database, database script, and/or ERwin data model. You can also generate reports using the Report Browser.

The first two options on the Tasks menu speed the process of creating a data model or creating a database from scratch, as explained below:

•	Forward Engineer . Choose this option to create a new database schema from an ERwin data model or save the schema DDL script as an ASCII text file. Forward engineering is intended for the first-time creation of tables, triggers, stored procedures, and other database objects.

•	Reverse Engineer . Choose this option to create a new ERwin data model from a SQL DDL or DF script or database catalog. After reverse engineering, you can save and print the new model, and update the model with changes you want to make to the database.

The Tasks menu also includes three options that let you synchronize an existing model with an existing database, and an option to open the ERwin Report Browser:

•	Update Model. Choose this option to compare an ERwin data model with an existing database, schema script file, ERwin data model, or ModelMart diagram. Then you can preview the differences and selectively update your model.

•	Alter Database. Choose this option to compare an ERwin data model with an existing database, schema script file, ERwin data model, or ModelMart diagram. After you select the items and the changes that you want to add or update in your database, ERwin generates a schema script file that contains all the statements necessary to safely update your database. You can run the script directly against the database catalog or save the script as an ASCII text file and run it against the database catalog at a later time.

•	Complete Compare. Choose this option to compare your data model with an existing database, schema script file, ERwin data model, or ModelMart diagram. When you choose the Complete Compare option, ERwin lists the differences between the source and target so you can:

•	Update your data model based on changes to the database, SQL DDL script, ERwin model, or ModelMart diagram.

•	Create, preview, and save a SQL DDL change script that you can use to alter an existing database.

•	Update the database based on changes to the data model.

•	Generate Reports. Choose this option to open the ERwin Report Browser. This menu option is equivalent to clicking the Report Browser button [image] on the ERwin toolbar. When you open the Report Browser, you can generate and edit any of the predefined reports, or create your own report.


Forward Engineering/Generating a Database Schema

The Forward Engineer/Schema Generation option on the Tasks menu lets you initially create your database schema, including tables, triggers, stored procedures, and other database objects.

ERwin gives you two choices when generating a database schema. You can:

•	Connect ERwin directly to the target server and generate the schema in one step. See Generating a Schema to a Target Server for more information.

•	Generate an ASCII DDL (Data Definition Language) script. A DDL script must be run as a separate step on the server to generate the schema. ERwin lets you generate the schema script and save it as a text file, which can be opened in Notepad, imported into a word processing application, or loaded by any utility used to interpret SQL scripts such as SPUFI for DB2, ISQL for SQL Server, SQL*DBA for ORACLE, or SQLTalk for SQLBase. See Saving a Schema Generation Report  for more information.

Both options are available to you when you forward engineer a database using the Schema Generation Report Editor, or when you alter a database using the Alter Database option or Complete Compare .

Related Topics

  Using the Schema Generation Editor

  Previewing the Schema Generation Report


Using the Schema Generation Editor

To generate a schema, you define and execute a special type of ERwin report called a schema generation report using the Schema Generation Report Editor. When you choose Forward Engineering/Schema Generation on the Tasks menu, ERwin opens the Schema Generation Report Editor.

The <Database> Schema Generation Report Editor lets you choose which ERwin physical object definitions, such as tables, indexes, triggers, and stored procedures, you want to include in the generated schema. The target server you select determines which options appear in the Editor. You can also create different option sets so that you can generate schema for different development stages. For example, you can create an option set to generate index schema only.

The purpose of the tabs on the Schema Generation Report Editor are explained below:

•	Options. Set the schema options for forward engineering. These include Referential Integrity, Trigger, Schema, Table, View, Column, Index, and other options.

•	Summary. Review selected schema options, clear all options, and modify the selected options.

•	Comment. Type a comment for the specified option set.

The controls that appear in the <Database> Schema Generation Report Editor are explained below:

•	Option Set. Displays the name of the current report option set. To select a different schema option report, select a different report from the list.

•	New. Click this button to open the New Report dialog and save the current options under a new report name.

•	Rename. Click this button to open the Rename Report dialog and edit the name of the selected report.

•	Delete. Deletes the selected report.

•	Filter. Click this button to open the Table Filter dialog and choose which tables in the current subject area you want to forward engineer. See Using the Report Filter Editor for more information. If you filter the tables you want to generate, you may also want to filter dangling relationships for those tables. See Filtering Dangling Relationships for more information.

•	Preview. Click this button to open the Schema Generation Report Preview dialog and preview the report on screen. See Previewing the Schema Generation Report for more information.

•	Print. Prints a copy of the schema generation report to the default Windows printer.

•	Report. Saves the report as a ERS or SQL text file. This option is used to save a DDL script, which can be opened in standard text editors and run against the target database using SQL query and execution tools. See Saving a Schema Generation Report for more information.

•	Generate. Starts the schema generation process. ERwin displays the <Database> Connection dialog, which lets you log on to the target server and connect ERwin to the system catalog in the target database. In order to connect to the target server, the correct client connectivity software for your server must be installed on your computer. In addition, some databases, such as Access and Paradox, require and ODBC connection in order to generate a schema. See Defining ODBC Data Sources for more information.

When you log on to a target server, ERwin creates an active bi-directional connection to the system catalog for your selected target server. This connection lets you forward engineer a schema directly to the target database catalog; you do not have to run a generated data definition script as a separate process.

Related Topics

  Forward Engineering/Generating a Database Schema

  Setting Options for Forward Engineering

  To save a schema DDL script file

  To generate the schema from the Preview window

  To generate the schema directly to the target server


Setting Options for Forward Engineering

You can use the Options tab of the <Database> Schema Generation Report Editor to specify which physical objects you want to include in the schema.

The target server you select determines the available options. For example, to include any ORACLE Tablespace objects you defined in ERwin in the schema, select the TABLESPACE check box in the Schema option category.

Click on an option category in the list below to see a comprehensive list of options for that category:

•	Schema

•	Table

•	View

•	Column

•	Index

•	Referential Integrity

•	Trigger

•	Other Options

Related Topics

  Using the Schema Generation Editor

  To set schema generation options


Schema Options

You can use the Schema options on the <Database> Schema Generation Report Editor to control schema-level features of the generated schema. Select one or more of the following options:

•	<PHYSICAL OBJECT>. Select this check box to include any physical object definitions in the schema that ERwin generates.

•	Create Procedure. Select this check box to include any schema stored procedures in the schema that ERwin generates.

•	Drop Procedure. Select this check box to include DROP PROCEDURE statements in the schema that ERwin generates.

•	Drop Macro. Select this check box to include DROP MACRO statements in the schema that ERwin generates (Teradata only).

•	Pre-Script. Select this check box to execute prescripts attached to a schema before the schema is generated.

•	Post-Script. Select this check box to execute postscripts attached to a schema after the schema is generated.

•	DISTINCT DATATYPE. Select this check box to include CREATE DISTINCT statements for each DB2/2 user datatype in the schema that ERwin generates. You can define DB2/2 user datatypes in the ERwin Domain Editor.

•	CREATE DOMAIN. Select this check box to include CREATE DOMAIN statements for each InterBase or Rdb user datatype in the schema that ERwin generates. You can define InterBase and Rdb user datatypes in the ERwin Domain Editor.

•	Create DATATYPE. Select this check box to include CREATE DATATYPE statements for each SQL Anywhere user datatype in the schema that ERwin generates. You can define SQL Anywhere user datatypes in the ERwin Domain Editor.

•	TABLESPACE. Select this check box to include CREATE TABLESPACE statements in the schema that ERwin generates.

•	ROLLBACK SEG. Select this check box to include CREATE ROLLBACK SEGMENT statements in the schema that ERwin generates.

•	DATABASE. Select this check box to include CREATE DATABASE statements in the schema that ERwin generates.

•	SEGMENT. Select this check box to include CREATE SEGMENT statements in the schema that ERwin generates.

•	CREATE DBSPACE. Select this check box to include CREATE DBSPACE statements in the schema that ERwin generates.

•	sp_addtype. Select this check box to include sp_addtype statements in the schema that ERwin generates.

•	CREATE RULE. Select this check box to include validation rule definitions in the schema that ERwin generates.

•	CREATE DEFAULT. Select this check box to include default value definitions in the schema that ERwin generates.

Related Topics

  Setting Options for Forward Engineering

  Forward and Reverse Engineering Validation Rules


View Options

You can use the View options on the <Database> Schema Generation Report Editor to control the statements pertaining to views in the schema that ERwin generates. Select one or more of the following options.

•	CREATE VIEW. Select this check box to include CREATE VIEW statements for each selected view in the schema that ERwin generates.

•	DROP VIEW. Select this check box to execute DROP VIEW statements before executing CREATE VIEW statements when the schema is generated. ERwin executes a DROP VIEW statement for each CREATE VIEW statement in the schema.

•	Pre-Script. Select this check box to execute prescripts attached to a view immediately before the view is generated.

•	Post-Script. Select this check box to execute postscripts attached to a view immediately after the view is generated.

Related Topics

  Setting Options for Forward Engineering

  Using the View Editor


Table Options

You can use the Table options on the <Database> Schema Generation Report Editor to specify what data definition statements you want to use in generating the schema. Select one or more of the following options:

•	CREATE TABLE. Select this check box to include a CREATE TABLE statement for each selected table when generating the schema.

•	Entity Integ. Select this check box to include SQL statements that create constraint rules for each table.

•	DROP TABLE. Select this check box to execute DROP TABLE/Delete Table statements before executing CREATE TABLE statements when the schema is generated. ERwin executes a DROP TABLE statement for each CREATE TABLE statement in the schema.

•	Integrity/Check. Select this check box to include statements for table-level check constraints in the schema that ERwin generates to Ingres/OpenIngres. You can choose how check constraints are generated in the schema (i.e., as CREATE INTEGRITY ON statements or as CHECK statements) in the Validation Rule Editor.

•	Physical Storage. Select this check box to include physical storage objects and parameters in the schema.

•	Table CHECK. Select this check box to include SQL statements that create constraint rules for each table.

•	Table Pre-Script. Select this check box to execute prescripts attached to a table immediately before the table is generated.

•	Table Post-Script. Select this check box to execute postscripts attached to a table immediately after the table is generated.

•	VALIDPROC/Check. Select this check box to include statements for table-level check constraints in the schema that ERwin generates to DB2/MVS. You can choose how table-level check constraints are generated in the schema (for example, as VALIDPROC statements or as CHECK statements) in the Validation Rule Editor.

•	Validation. Select this check box to include any validation rules associated with tables in the schema as table-level check constraints. For PROGRESS, this option is only available when you choose to generate the schema using the PROGRESS 4GL option.

•	Create Alias. Select this check box to include any table alias names that you defined in ERwin in the schema that ERwin generates (DB2/2 and DB2/MVS only).

•	Drop Alias. Select this check box to include statements that drop previously defined alias table names. ERwin executes a DROP statement for each CREATE alias statement in the schema that ERwin generates (DB2/2 and DB2/MVS only).

•	Create Macro. Select this check box to include Teradata macro statements in the schema that ERwin generates (Teradata only).

•	Drop Macro. Select this check box to include statements that drop previously defined Teradata macros. ERwin executes a DROP statement for each CREATE macro statement in the schema that ERwin generates (Teradata only).

•	CREATE SYNONYM. Select this check box to include synonym table names that you defined in ERwin in the schema that ERwin generates.

•	DROP SYNONYM. Select this check box to include statements that drop previously defined synonym table names. ERwin executes a DROP statement for each CREATE synonym statement in the schema that ERwin generates.

•	Create Procedure. Select this check box to include any stored procedures that you defined in ERwin in the schema that ERwin generates.

•	Drop Procedure. Select this check box to include statements that drop previously defined stored procedures in the schema that ERwin generates. ERwin executes a DROP statement for each CREATE procedure statement in the schema that ERwin generates.

•	Partitions. Select this check box to include partition clause statements in the schema that ERwin generates (Oracle 8 only).

Note:	When ERwin generates a schema on the server, any changes made in ERwin to table properties, such as changing the table's name, columns, or relationships, are not updated on the server unless you DROP the modified table and then CREATE it again. Select the DROP TABLE and CREATE TABLE option boxes on the Schema Generation Report to replace the old table with the new table.

Related Topics

  Setting Options for Forward Engineering

  Using the Table Editor

  Forward and Reverse Engineering Validation Rules


Column Options

You can use the Column options on the <Database> Schema Generation Report Editor to add additional clauses to the SQL CREATE TABLE statements in the schema that ERwin generates. Select one or more of the following options:

•	Attribute Integ. Select this check box to include constraint statements for each column for which they are defined.

•	Column CHECK. Select this check box to include constraint statements for each column for which they are defined.

•	Default or DEFAULT Value. Select this check box to include default value statements for each column for which they are defined.

•	Integrity/Check. Select this check box to include statements for column-level check constraint in the schema that ERwin generates to Ingres/OpenIngres. You can choose how check constraints are generated in the schema (as CREATE INTEGRITY ON statements or as CHECK statements) in the Validation Rule Editor.

•	Physical Order. Select this check box to preserve the physical order of the columns as ERwin generates the new schema.

•	sp_bindrule. Select this check box to include a statement that binds the constraint rule to the column.

•	sp_bindefault. Select this check box to include a statement that binds the default constraint rule to the column.

•	User Datatype. Select this check box to include a User Datatype for the column in the schema statement (SQL Anywhere only).

•	Validation. Select this check box to include the validation rule for the column in the schema statement.

•	FIELDPROC/Check. Select this check box to include statements for column-level check constraints in the schema that ERwin generates to DB2/MVS. You can choose how column-level check constraints are generated in the schema (as FIELDPROC statements or as CHECK statements) in the Validation Rule Editor.

•	Initial Value. Select this check box to include a statement assigning column initial values.

•	Column Label. Select this check box to include a statement assigning column labels.

•	Label. Select this check box to include a statement assigning column labels.

•	Column Heading. Select this check box to include a statement assigning column headings.

•	Check Constr. Select this check box to include constraint statements for each column for which they are defined.

•	Use Domain. Select this check box to include the user-defined datatype Domain for the column in the schema statement (InterBase and Rdb only).

•	Use Distinct Type. Select this check box to include the user-defined Distinct Type for the column in the schema statement (DB2/2 only).

•	BETWEEN. Select this check box to include the validation rule for the column in the schema statement (Teradata only).

•	TITLE. Select this check box to include a statement assigning column titles.

Related Topics

  Setting Options for Forward Engineering

  Using the Column Editor

  Forward and Reverse Engineering Validation Rules


Index Options

You can use the Index options on the <Database> Schema Generation Report Editor to control how indexes are created and stored and which key attributes are indexed. Select one or more of the following options:

•	Create Index. Select this check box to select one or more of the following create index options:

•	Primary Key (PK). Select this check box to create an index on the primary key in each table.

•	Alternate Key (AK). Select this check box to create an index for each alternate key in each table.

•	Foreign Key (FK). Select this check box to create an index for each foreign key in each table.

•	Inversion Entry (IE). Select this check box to create an index on the inversion entry in each table.

•	Drop Index. Select this check box to select one or more of the following drop index/delete index options.

•	Primary Key (PK). Select this check box to drop primary key indexes in each table.

•	Alternate Key (AK). Select this check box to drop alternate key indexes in each table.

•	Foreign Key (FK). Select this check box to drop foreign key indexes in each table.

•	Inversion Entry (IE). Select this check box to drop inversion entry indexes in each table.

•	CLUSTERED or CLUSTERED HASHED. Select this check box to create a clustered or clustered hashed index in the schema, when this option is specified in the Index Editor.

•	Physical Storage. Select this check box to include index physical storage information in the schema.

•	PRIMARY. Select this check box to include a UNIQUE PRIMARY INDEX clause in the schema.

•	Write PRG File. Select this check box to create an ERwin ASCII file that must be run on the target server to create the index.

•	.ndx Index (or any Xbase single index file format). Select this check box to include single index files in the generated schema (Clipper and dBASE only).

•	.ntx Index Files. Select this check box to include multiple index files in the generated schema (Clipper).

•	.idx Index Files (or any Xbase single index file format). Select this check box to include single index files in the generated schema (FoxPro).

•	.cdx Index Files (or any Xbase multiple index structure). Select this check box to include multiple index files in the generated schema (FoxPro).

•	.mdx Index (or any Xbase multiple index structure). Select this check box to include multiple index files in the generated schema (dBASE).

Related Topics

  Setting Options for Forward Engineering

  Using the Index Editor

  Forward and Reverse Engineering Indexes


Referential Integrity Options

You can use the Referential Integrity (RI) options on the <Database> Schema Generation Report Editor to control how related records are treated when the value in a key field is modified or deleted. You can also choose if the schema includes a CREATE or ALTER statement for each primary or foreign key. If the table that requires a new key that already exists in the database, use the ALTER option. Select one or more of the following options:

•	Primary Key. Select this check box to enforce the unique identification of each row in a table.

•	CREATE/PK. Click this button to include a PRIMARY KEY clause in a CREATE TABLE statement.

•	ALTER/PK (default). Click this button to include the PRIMARY KEY clause in an ALTER TABLE statement.

•	Foreign Key. Select this check box to enforce the specified referential integrity rule when the value in a foreign key field is updated.

•	CREATE/FK. Click this button to include a FOREIGN KEY clause in a CREATE TABLE statement.

•	ALTER/FK (default). Click this button to include the FOREIGN KEY clause in an ALTER TABLE statement.

•	On Delete. Select this check box to enforce the selected referential integrity option if the value is deleted in either a primary or foreign key field.

•	On Update. Select this check box to enforce the selected referential integrity option if the value is updated in either a primary or foreign key field.

•	Unique (AK). Select this check box to enforce the rule requiring that alternate keys values must be unique.

•	sp_primary key. Select this check box to include the system procedure that creates the primary key in each table.

•	sp_foreign key. Select this check box to include the system procedure that creates foreign keys.

•	Create Relation. Select this check box to create relation objects. (Access only)

•	Delete Relation. Select this check box to delete relation objects. (Access only)

Related Topics

  Trigger Options

  Setting Options for Forward Engineering

  Using the Relationship Editor in the Physical Model


Trigger Options

You can use the Trigger options on the <Database> Schema Generation Report Editor to override ERwin's default RI templates to enforce referential integrity. Select one or more of the following options:

•	ERwin Generated. Select this check box to include ERwin-generated RI triggers in the schema for all RI options.

•	RI Type Override. Select this check box to include either an RI Type Override trigger (if available) or ERwin-generated trigger in the schema for all RI options.

•	Relationship Override. Select this check box to include either a Relationship Override trigger (if available) or ERwin-generated trigger in the schema for all RI options.

•	User Defined. Select this check box to include Table Override triggers in the schema. If no other options are selected, Table Override triggers include the default ERwin-generated trigger code.

•	RI Type Override. Select this check box to include RI Type Override trigger code (if available) in Table Override triggers in the schema.

•	Relationship Override. Select this check box to include Relationship Override trigger code (if available) in Table Override triggers in the schema.

Related Topics

  Setting Options for Forward Engineering

  Working with Triggers


Other Options

You can use the Other options on the <Database> Schema Generation Report Editor to support special features offered by the selected target server. Select one or more of the following options:

•	Comments. Select this check box to include ERwin table and column comments in the schema that ERwin generates. This options is available for all target servers in ERwin, so that comments can be included in the DDL script either for documentation or for portability of the definitions from one ERwin model to another.

Note:	You should NOT generate comments to your target server if the target server does not support them.

•	Constraint Name. Select this check box to include the constraint names in the schema that ERwin generates.

•	Quote Names. Select this check box to insert quotation marks around table and column names in the schema that ERwin generates.

•	Owner. Select this check box to include the individual table owner in the CREATE TABLE statement in the schema that ERwin generates.

•	No Delim. (Rdb only)

•	No CR. (Rdb only)

•	Use Labels for Logical Names. Select this check box to include labels for tables based on entity names in the schema that ERwin generates (AS/400 only).

Related Topics

  Setting Options for Forward Engineering


To set schema generation options

1.	Open an existing ERwin or ModelMart data model.

2.	Click [image] and select the <Main Subject Area> or a custom subject area you want to generate from the list.

3.	Choose Forward Engineer/Schema Generation on the Tasks menu.

4.	Select an option set from the Option Set list.

5.	Click the Options tab on the <Database> Schema Generation Editor.

6.	Select an option category from the list on the left, then select the check boxes for the options you want to include in the schema from the list on the right.

7.	Repeat step 6 for each option category (Referential Integrity, Trigger, Schema, etc.)


Reviewing Schema Generation Options

The Summary tab of the Schema Generation Report Editor displays the full list of schema generation options. You can display, change, or clear selected check box options.

The purpose of each control in the Summary tab of the Schema Generation Report Editor is explained below:

•	Show Selected Only. Select this button to display only the selected schema options.

•	Edit Options. Select this button to edit any of the schema generation options. You can edit all schema generation options that are available in the Options tab. When you select this button, the following buttons become available (not dimmed):

•	Expand All. Click this button to expand all options in the list. You can use the scroll bar to scroll down the list of options.

•	Collapse All. Click this button to collapse the schema option hierarchy to the category level which includes Referential Integrity, Trigger, Schema, Table, View, Column, Index, and Other options.

•	Clear All. Click this button to clear all option selections.

Related Topics

  Using the Schema Generation Editor

  To show selected schema options

  To clear all selected schema options

  To change selected schema options


To show selected schema options

1.	Open an existing ERwin or ModelMart data model.

2.	Click [image] and select the subject area that you want to generate from the Subject Area list.

3.	Choose Forward Engineer/Schema Generation on the Tasks menu.

4.	Select an option set from the Option Set list.

5.	Click the Summary tab on the <Database> Schema Generation Editor.

6.	Click Show Selected Only. Only the selected schema options display.


To clear all selected schema options

1.	Open an existing ERwin or ModelMart data model.

2.	Click [image] and select the subject area that you want to generate from the Subject Area list.

3.	Choose Forward Engineer/Schema Generation on the Tasks menu.

4.	Select an option set from the Option Set list.

5.	Click the Summary tab on the <Database> Schema Generation Editor.

6.	Click Clear All to clear all option selections.


To change selected schema options

1.	Open an existing ERwin or ModelMart data model.

2.	Click [image] and select the subject area that you want to generate from the Subject Area list.

3.	Choose Forward Engineer/Schema Generation on the Tasks menu.

4.	Select an option set from the Option Set list.

5.	Click the Summary tab on the <Database> Schema Generation Editor.

6.	Click the Edit Options button.

7.	Select or clear the check boxes for the options listed. Selected options will be included in the generated schema DDL script.


Specifying a Schema Option Set Comment

You can use the controls in the Comment tab of the Schema Generation Report Editor to view and update the option set comment.

The purpose of each control in the Comment tab of the Schema Generation Report Editor is explained below:

•	Comment. Type or edit the comment for the selected option set.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Using the Schema Generation Editor

  To specify an option set comment


To specify an option set comment

1.	Open an existing ERwin or ModelMart data model.

2.	Click [image] and select the subject area that you want to generate from the Subject Area list.

3.	Choose Forward Engineer/Schema Generation on the Tasks menu.

4.	Select an option set from the Option Set list.

5.	Click the Comment tab on the <Database> Schema Generation Editor.

6.	Type a comment in the Comment text box.


Previewing the Schema Generation Report

After you select schema generation options, you can click the Preview button on the Schema Generation Report Editor to preview the DDL script for your target server. The contents of the script reflect both the options selected in the <Database> Schema Generation Report and the entities and other database objects in the ERwin data model.

The Schema Generation Report Preview dialog displays the schema DDL script generated by ERwin for the current data model. ERwin generates the DDL script based on the options you selected in <Database> Schema Generation Report Editor. For example, if you select the Create Table box in the <Database> Schema Generation Report Editor, you can view the CREATE TABLE commands that ERwin generates in the Preview dialog.

The purpose of each toolbar button is explained below:

•	 . Saves the text displayed in the dialog text box to a ASCII text file with the .ers or .sql extension. After ERwin saves the file, you can edit the file in a text editor and run it against the database using a utility that interprets SQL scripts such as SPUFI for DB2, ISQL for SQL Server, SQL *DBA for ORACLE, or SQLTalk for SQLBase.

•	 . Prints the text displayed in the dialog text box to the Windows default printer.

•	. Opens the Find dialog and search for a text string in the report. Type a text string in the Find What text box and click Find Next to search the dialog text box for occurrences of the text string. Check the Match Case box if you want the search to be case sensitive (for example, typing “CREATE” does not find "Create").

•	. Opens the Replace dialog, search for a text string, and replace it with a new text string.

•	 Cuts, copies, and pastes text using the Clipboard.

•	Generate. Starts the schema generation process. If you are not already connected to the target server, ERwin displays the <Database> Connection dialog. After you log on, ERwin begins to generate the schema automatically.

•	Close. Closes the Preview dialog and returns to the Schema Generation Report Editor.

Related Topics

  Forward Engineering/Generating a Database Schema

  To generate the schema from the Preview window


To generate the schema from the Preview window

1.	Open an existing ERwin or ModelMart data model.

2.	Click [image] and select the subject area that you want to generate from the Subject Area list.

3.	Select Forward Engineering/Schema Generation on the Tasks menu.

4.	Select an option set from the Option Set list.

5.	Select the check boxes for the options you want to include in the schema. More>

6.	Click the Preview button.

Note:	The maximum amount of information that can be displayed in the Preview window is 32 KB (32,000 bytes). If you try to preview a script that exceeds 32 KB in size, ERwin cancels the display and prompts you to use another editor to preview the report output.

6.	Choose one of the following options:

•	To generate the entire schema, click Generate.

•	To generate a portion of the schema rather than the entire schema, select a portion of the schema text then click Generate.

•	To print the schema script as it appears in the Preview window, click [image].

•	To save the schema script, click [image].

7.	When you click Generate, ERwin displays the <Database> Connection dialog. Log on to the target server. More>

8.	When schema generation is complete, ERwin displays the Schema Generation Complete message in the Generate Database Schema dialog window. Optionally, choose one or more of the following:

•	To save the message log to a file, click [image].

•	To print the message log to the default printer, click [image].

•	To view or search the message log, use the [image] (Find) button or the scroll bar to navigate through the displayed message log.

•	To close the message log, click OK.

9.	Click Close to close the Schema Generation Report Editor.

Note:	To cancel generation of the ERwin Dictionary, click Abort. If the execution of a statement fails, ERwin displays an error message in the message log. Click Abort to cancel generation or click Continue to execute the next schema statement.

If you need to regenerate the same ERwin model schema in the same database, you can use the above procedure, however, be sure to select the Drop Table check box in the Schema Generation Report Editor. When the Drop Table option is checked, all the existing tables referenced in the schema are deleted before ERwin generates new tables. The information stored in dropped tables is lost. If you want to preserve the data in the tables, use the Complete Compare option on the Tasks menu instead of the Forward Engineer/Schema Generation option.


Saving a Schema Generation Report

You can save the DDL script for your target server in a standard ASCII text file. When you click the Report button on the Schema Generation Report Editor, ERwin displays the Generate <Database> SQL Schema Report dialog.

Type a name for the DDL script file in the File name text box. You can save the file with the default .ers (ERwin SQL) extension or type the file name with the SQL extension if your target server or SQL processor requires it.

ERwin saves the schema as a text file. After ERwin saves the file, you can edit the file in a text editor and run it against the database using a utility that interprets SQL scripts, such as SPUFI for DB2, ISQL for SQL Server, SQL *DBA for ORACLE, or SQLTalk for SQLBase.

Note:	ERwin creates a script file for Access, dBASE, FoxPro, Clipper, and Paradox using forward engineering. Unlike SQL databases, however, you cannot use this script for reverse engineering. These databases can be reverse engineered directly from the .mdb or .dbf database files.

Related Topics

  Forward Engineering/Generating a Database Schema

  To save a schema DDL script file


To save a schema DDL script file

1.	Open an existing ERwin or ModelMart data model.

2.	Click [image] and select the subject area that you want to generate from the Subject Area list.

3.	Select Forward Engineering/Schema Generation on the Tasks menu.

4.	Select an option set from the Option Set list.

5.	Select the check boxes for the options you want to include in the schema. More>

6.	Click Report.

7.	Type a new name in the File name text box.

8.	Click OK.

Note:	ERwin can create a script file for Access, dBASE, FoxPro, Clipper, and Paradox using forward engineering. Unlike SQL databases, however, you cannot use this script for reverse engineering. These databases can be reverse engineered directly from the .mdb or .dbf database files.


Generating a Schema to a Target Server

When you click the Generate button in the <Database> Schema Generation Report Editor or Schema Generation Report Preview Editor, ERwin attempts to log on to the target server and execute the generated DDL statements against the database on the target server. If you have selected DROP and CREATE for database objects, ERwin executes the DROP command first, then executes the CREATE command.

During execution of the DDL script, ERwin displays the Generate Database Schema dialog, in which you view the results of each statement. If ERwin encounters a problem during schema generation and you have selected the Stop If Failure check box, ERwin discontinues processing the file and displays an error message in the dialog window.

You can click the Abort button to cancel schema generation or click Continue to continue generating the schema. If you choose Abort, ERwin discontinues processing the file. All statements that executed successfully before the failure are applied to the database catalog; all other statements, including the failed statement, are ignored. You can also clear the Stop If Failure box if you do not want ERwin to pause each time a statement fails to execute.

When processing is complete, you can edit the statements and messages in the dialog window using the standard keyboard editing keys. You can also use the buttons at the top of the dialog to search for special text strings or copy, cut, and paste text in the log. You can also save the log as an ASCII text file or print it to the default Windows printer.

The purpose of each control on this dialog is explained below:

•	Stop If Failure. Select this check box if you want ERwin to pause execution of the DDL script each time a problem is encountered. Clear this check box to continue processing without pausing after failed statements.

•	Abort. Cancels schema generation.

•	Continue. Continues schema generation after a failure.

•	Pause. Temporarily pauses schema generation. While ERwin is generating the schema, it displays the Pause button in place of the Continue button.

The purpose of each toolbar button is explained below:

•	. Saves the text displayed in the dialog text box to a ASCII text file with the .ere extension.

•	. Prints the text displayed in the dialog text box to the Windows default printer.

•	 . Click this button to open the Find dialog and search for a text string in the report. Type a text string in the Find What text box and click Find Next to search the dialog text box for occurrences of the text string. Check the Match case box if you want the search to be case sensitive (for example, typing “CREATE” does not find "Create").

•	 Cuts, copies, and pastes text using the Clipboard.

Related Topics

  Forward Engineering/Generating a Database Schema

  To generate the schema directly to the target server


To generate the schema directly to the target server

1.	Open an existing ERwin or ModelMart data model.

2.	Click [image] and select the subject area that you want to generate from the Subject Area list.

3.	Choose Forward Engineer/Schema Generation on the Tasks menu.

4.	Select an option set from the Option Set list.

5.	Select the check boxes for the options you want to include in the schema. More>

6.	Choose one or more of the following options:

•	To view the script generated by ERwin, click Preview.

•	To save the script, click Report.

•	To change the number of tables that you want to generate, click Filter.

•	To print a copy of the report, click Print.

7.	Click Generate.

8.	Log on to the target server. More>

9.	When schema generation is complete, ERwin displays the Schema Generation Complete message in the Generate Database Schema dialog window. Optionally, choose one or more of the following:

•	To save the message log to a file, click [image].

•	To print the message log to the default printer, click [image].

•	To view or search the message log, use the [image] (Find) button or the scroll bar to navigate through the displayed message log.

•	To close the message log, click OK.

10.	Click Close to close the Schema Generation Report Editor.

Note:	The maximum amount of information that can be contained in the log is 32 KB (32,000 bytes). If your log is longer than 32 KB, only the last 32 KB of the log text is available to view, print, or save.


Reverse Engineering from a DDL Script or Database

During reverse engineering, ERwin captures the information in your database or script file, including tables, columns, relationships, triggers, stored procedures, validation rules, and physical storage properties, and automatically creates both a logical and physical model in your ERwin diagram based on this information. You can then use the ERwin tools and editors to add new database objects, create system documentation, and redesign the database structure based on changing requirements.

You can easily reverse engineer an entire database or you can selectively reverse engineer specific classes of database objects, such as tables or stored procedures, or individual objects, such as a table or set of tables.

While much of the information that is reverse engineered is explicitly defined in the physical schema, ERwin also derives information from the schema and incorporates it into the diagram. For example, if the target server supports foreign key declarations, ERwin automatically derives identifying and non-identifying relationships and default rolenames for the data model during reverse engineering.

ERwin can derive all the major model information except subtype relationships, that are not supported by any SQL DBMS at this time. However, the target databases vary in the amount of information about the logical data model that is included in the physical schema. For this reason, the resulting models can vary depending on the target database selected. ERwin can also infer some logical information, including primary and foreign keys and table relationships, based on table index definitions or column names.

Related Topics

  Selecting a Template for a New Diagram

  Selecting the Target Server During Reverse Engineering

  Setting Options for Reverse Engineering

  To reverse engineer from a DDL or DF script file

  To reverse engineer from a target database


Selecting the Target Server During Reverse Engineering

When you reverse engineer from a target database, or SQL DDL, or DF script file, you must first specify the diagram template for the new diagram. After you specify the template, ERwin displays the Reverse Engineer - Select Target Server dialog when you choose Reverse Engineer on the Tasks menu, or when you open a file with the .sql, .ers, or .df extension on the File menu.

The purpose of each control on the Reverse Engineer - Select Target Server dialog is explained below:

•	Target SQL DBMS. Click a button in the group box to select a SQL-based target database. In most cases, you must also select the correct version of the target database in the <Database> Version list.

•	Target Desktop DBMS. Click a button in the group box to select a PC desktop database.

•	<Database> Version. Select the version of the target server that you want to use from the list. This control is only available when ERwin supports more than one version of the selected target server.

•	<Back. Unavailable in this dialog.

•	Next>. Opens the Set Options dialog for reverse engineering.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  Reverse Engineering from a DDL Script or Database

  Selecting a Template for a New Diagram

  Setting Options for Reverse Engineering


Setting Options for Reverse Engineering

The final step in reverse engineering is choosing the database objects and properties that you want to import, setting case conversion options, and deciding whether or not you want to infer primary key or relationships from indexes.

When you click Next> in the Reverse Engineer - Select Target Server dialog, ERwin opens the Reverse Engineer - Set Options dialog.

The purpose of each control in the Reverse Engineer From group box is explained below:

•	Database. Click this button to reverse engineer from an existing database.

•	Script File. Click this button to reverse engineer from an existing SQL DDL or DF (Progress) script file. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	File. Type the name of the script file (for example, C:\ER\MOVIES.SQL) that you want to reverse engineer. If you click the Browse button and select a file, ERwin displays the name of the file you selected in this text box. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	Browse. The Browse button is available when you click the Script File button. When you click Browse, ERwin displays the Open dialog so that you can select a path and the name of an existing SQL DDL or DF (Progress) script file. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

The purpose of each control in the Items to Reverse Engineer group box is explained below:

•	Option Set (combo box). Type or select a name for a user-defined set of options, update the name of an existing option set using the standard editing keys, or select a user-defined option set.

•	New. Saves the selected items as a named option set. ERwin saves the settings in the Option Set list under the name specified in the Option Set combo box.

•	Update. Updates an existing option set. ERwin saves the new settings and/or updates the option set name.

•	Delete. Deletes a saved option set.

•	Option Set (list box). Displays a complete list of the database items supported by Complete Compare. Clear the check box next to an item if you do not want ERwin to reverse engineer items of that type during synchronization. Select the check box if you want ERwin to reverse engineer items of that type.

The purpose of each control in the Reverse Engineer group box is explained below. Controls are unavailable (dimmed) if you are reverse engineering from a SQL script file.

•	System Objects. Select this check box to compare your model with both system and user tables. Clear the check box to compare your model with user tables only.

•	Tables/Views Owned By (group box). Choose one of the following options to filter the table and view comparison based on owner name:

•	All. Click this button to compare your model with all tables and views in the database, regardless of the owner.

•	Current User. Click this button to compare your model with only those tables or views owned by the current user as entered in the User Name text box on the <Database> Connection dialog.

•	Owners (comma separated): Click this button to filter the tables/views that ERwin will reverse engineer to the tables/views owned by the owner name or names (separated by commas) specified in this box.

•	In. Click this button to open the Filter By Table Container dialog and select one or more TABLESPACEs or databases that you want to reverse engineer. (DB2/MVS only) See Selecting Tablespaces and Databases for Reverse Engineering and Complete Compare for more information.

The purpose of each control in the Infer group box is explained below:

•	Primary Keys. Select this check box if you want ERwin to infer primary key columns for tables based on defined indexes.

•	Relations. Select this check box if you want ERwin to infer relationships between tables based on either primary key column names or defined indexes, based on the option you select in the From group box.

•	From. The purpose of each control in the From group box is explained below:

•	Names. Select this check box to infer relationships from the primary key column names. When selected, ERwin infers a relationship between two tables if all of the primary key columns of the parent are in the child table.

•	Indexes. Select this check box to infer relationships from the table indexes. When selected, ERwin infers the relationship between two tables only if the primary key columns of the parent table are in an index in the child table.

Note:	If the target database or DDL script file supports primary key and foreign key declarations, you do not need to use the options in the Infer group box. See Inferring Primary Key and Relationship Information for more information.

The purpose of each control in the Case Conversion of Physical Names group box is explained below:

•	None. Select this check box if you want ERwin to preserve the case of physical names exactly as they appear in the source file or database. ERwin reverse engineers the names without case conversion.

•	lower. Select this check box if you want ERwin to change physical names to lowercase during reverse engineering (e.g., ERwin converts the table name Movie_copy to movie_copy).

•	UPPER. Select this check box if you want ERwin to change physical names to uppercase during reverse engineering (e.g., ERwin converts the table name Movie_copy to MOVIE_COPY).

The purpose of each control in the Case Conversion of Logical Names group box is explained below:

•	None. Select this check box if you want ERwin to create logical names that preserve the case of physical names exactly as they appear in the target database or DDL script. ERwin creates the logical names in the ERwin model without case conversion.

•	lower. Select this check box if you want ERwin to create logical names in lowercase during reverse engineering (for example, ERwin converts the table name Movie_copy to movie copy).

•	UPPER. Select this check box if you want ERwin to create logical names in uppercase during reverse engineering (for example, ERwin converts the table name Movie_copy to MOVIE COPY).

•	Mixed. Select this check box if you want ERwin to capitalize the first letter of each word in a logical name during reverse engineering (for example, ERwin converts the table name ORDER_DETAIL to the Order Detail entity name.

Note:	To create logical names, ERwin also replaces underscores with spaces.

The remaining controls in the Options group box are explained below:

•	Import View Base Tables. Select this check box if you are importing a view and you want to import the tables referenced by the view (base tables). If you select this check box, ERwin parses the SQL code for each view and automatically creates a view relationship to each referenced table in your data model. Clear the check box if you want ERwin to import all view columns as user-defined expressions. ERwin maintains information about the referenced tables even if you choose not to import them. Later if you import one or more of the referenced tables, ERwin automatically creates the view relationships to the imported tables.

•	Use Labels. This option is available when reverse engineering from an AS/400 system catalog or script file only. Select this check box if you want ERwin to use the labels in your AS/400 database or script file as logical names.

The navigation controls in the dialog are explained below:

•	<Back. Returns to the Select Target Server dialog.

•	Next>. Starts the reverse engineering process.

•	Cancel. Cancels the reverse engineering process.

Related Topics

  Reverse Engineering from a DDL Script or Database

  Selecting a Template for a New Diagram

  Selecting the Target Server During Reverse Engineering

  Filtering Items in the Set Options Dialog

  Inferring Primary Key and Relationship Information

  Case Conversion of Logical and Physical Names

  Selecting Tablespaces and Databases for Reverse Engineering and Complete Compare


Selecting Tablespaces and Databases for Reverse Engineering and Complete Compare

When you select Reverse Engineer, Update Model, Alter Database, or Complete Compare on the Tasks menu, ERwin displays the Set Options dialog. When you run ERwin’s Complete Compare or reverse engineering features against an DB2/MVS or ORACLE target server, the Set Options dialog includes the In button, which opens the Filter By Table Container dialog.

The purpose of each control in the Filter By Table Container dialog is explained below:

•	TABLESPACEs. Type the names of the DB2/MVS or ORACLE tablespaces that you want to compare or reverse engineer. If you are including the names of multiple tablespaces, separate each name in the text box with a comma.

•	Databases. Type the names of the DB2/MVS databases that you want to compare or reverse engineer. If you are including the names of multiple databases, separate each name in the text box with a comma (DB2/MVS only).

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  Setting Options for Reverse Engineering


To reverse engineer from a DDL or DF script file

1.	Choose Reverse Engineer on the Tasks menu. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

2.	Select a model template from the ERwin Template Selection dialog.

3.	Select the target server from which you want to reverse engineer in the Target SQL DBMS or Target Desktop DBMS group box and choose the version in the Version list if applicable.

4.	Click Next > . ERwin displays the Reverse Engineer - Set Options dialog.

5.	Click the Script File button.

6.	Click Browse and select the path and name of the script file you want to reverse engineer.

7.	Click Open.

8.	Choose the reverse engineering options that you want to use including:

•	The Option Set items you want to reverse engineer.

•	The options you want to use for inferring primary keys and/or relationships from index information.

•	The case conversion option you want to use for physical and logical names.

9.	Click Next >. ERwin parses the script file you selected and automatically lays out the model in a new diagram window.

At the end of the parsing process, you can view, print, and save a report of the parsing errors (if any).

10.	If you chose to infer primary keys and/or relationships in the Set Options dialog and the database catalog contains primary key and/or relationship information, ERwin prompts you to confirm your choice:

•	Click No to reverse engineer the existing primary keys and relationships only.

•	Click Yes to infer primary keys and relationships where they are not explicitly defined.

11.	Click Save on the File menu to save the new model.

Note:	You can also reverse engineer using the Open dialog, accessed from the File menu. Select the correct file extension from the list provided (.sql, .ers, .or .df) and choose the path and file name of the script file you want to reverse engineer.

When you reverse engineer from a database or script file, ERwin automatically creates a new model to hold the information. If you want to reverse engineer into an existing model, you must use the Update Model option on the Tasks menu rather than the Reverse Engineer option. See Update Model for more information.


To reverse engineer from a target database

1.	Choose Reverse Engineer on the Tasks menu.

2.	Select a model template from the ERwin Template Selection dialog.

3.	Select the target server from which you want to reverse engineer in the Target SQL DBMS or Target Desktop DBMS group box and choose the version in the Version list if applicable.

4.	Click Next > . ERwin displays the Reverse Engineer - Set Options dialog.

5.	Click the Database button.

6.	Choose the reverse engineering options you want to use, including:

•	The Option Set items you want to reverse engineer.

•	The options you want to use for inferring primary keys and/or relationships from index information.

•	The case conversion option you want to use for physical and logical names.

7.	Click Next >.

8.	Log on to the target server. More>

9.	If you chose to infer primary keys and/or relationships in the Set Options dialog and the database catalog contains primary key and/or relationship information, ERwin prompts you to confirm your choice:

•	Click No to reverse engineer the existing primary keys and relationships only.

•	Click Yes to infer primary keys and relationships where they are not explicitly defined.

10.	Click Save on the File menu to save the new model.

Note:	You can also start the reverse engineering process for Access, Clipper, dBASE, FoxPro, and Paradox target servers using the Open dialog, accessed from the File menu. Select the correct file extension from the list provided (.dbf or .mdb) and choose the path and file name of the database file you want to reverse engineer. After the database tables are reverse engineered, ERwin prompts you to reverse engineer corresponding indexes.

When you reverse engineer from a database or script file, ERwin automatically creates a new model to hold the information. If you want to reverse engineer into an existing model, you must use the Update Model option on the Tasks menu rather than the Reverse Engineer option. See Update Model for more information.


Synchronizing Data Models, Scripts, and Databases

Database environments are dynamic. No matter how well your original database is designed, you must be able to alter the database to support unforeseen needs and requirements as they arise. The same is true for your ERwin data model. If the goals for the database expand, you must be able to manage the changes to the data model in a controlled way and keep the model in sync with the database.

Without ERwin, when you forward engineer changes to your database you must also manually perform a variety of maintenance tasks, including unloading and reloading any altered database tables so that no data is lost. ERwin automates this process, so you can for example, generate the code to unload data to a temporary table, at the same time that you create the script that updates the table. ERwin also automates reverse engineering of the database, so that you can import database changes to your data model to keep the database and model synchronized.

The ERwin synchronization feature lets you compare the physical database information in an open ERwin data model with:

•	The catalog of a target database.

•	A DDL script for an existing database.

•	A different ERwin model saved as either an ER1 or ERX file.

•	An ERwin model saved in ModelMart.

ERwin detects the differences in tables and table properties, columns and column properties, views, triggers, defaults, stored procedures, and other database objects. You can then:

•	Update the current ERwin data model. See Updating an ERwin Model Using Synchronization  for more information.

•	Update the database, either directly or by generating an alter script, that can be customized and used to update the database. See Altering a Database Using Synchronization  for more information.

•	Update both the database and the model at the same time using Complete Compare. See Using Complete Compare  for more information.

Note:	ERwin supports a limited synchronization (name only) of physical storage objects. If you import a physical storage object and rename it, ERwin cannot export the name change, although it can export the information to create a new object.

ERwin does not compare or synchronize index physical properties, table physical properties, or synonyms.


Updating an ERwin Model Using Synchronization

You can use ERwin’s Update Model feature to compare an ERwin model with a target database, DDL script, ModelMart diagram, or ER1/ERX file. You can then use the differences that ERwin detects to:

•	Selectively undo changes in the current data model using a version of the model before the change, or an archive copy of your data model.

•	Document changes by printing a report that lists the differences between models.

•	Update the current model based on the changes in the database, script file, ERwin model, or ModelMart diagram.

Note:	When you choose the Update Model option on the Tasks menu, ERwin updates the active model. No changes are made to the target database, script file, ModelMart diagram or ERwin model with which you are comparing the active model. If you want to bidirectionally synchronize a model and a database or script file, use the Complete Compare option on the Tasks menu. See Using Complete Compare  for more information.

Related Topics

  Setting Synchronization Options When Updating a Model

  Resolving Differences When Updating a Model

  Importing Changes to Update an ERwin Data Model

  To update an ERwin data model


Setting Synchronization Options When Updating a Model

When you choose Update Model on the Tasks menu, ERwin displays the Update Model - Set Options dialog.

The purpose of each control in the Compare Current Model with group box is explained below:

•	Database. Click this button to compare the current model with an existing database.

•	Script File. Click this button to compare the current model with an existing SQL DDL script file. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	ModelMart Diagram. Click this button to compare the current model with a model stored in ModelMart. This option is available if you are currently logged on to ModelMart.

•	ER1/ERX File. Click this button to compare the current model with an existing ER1 or ERX file.

•	File Name. Type the name of the file (e.g., C:\ER\MOVIES.SQL) or ModelMart diagram (e.g., mylibrary..mymodel) that you want to compare with the current model. If you click the Browse button and select a file, ERwin automatically displays the name of the file or diagram you selected in this text box. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	Browse. The Browse button is available if you click the Script File, ER1/ERX File, or ModelMart Diagram button. When you click Browse, ERwin displays the Open dialog so that you can select a path and the name of an existing SQL DDL script, ER1/ERX file, or ModelMart model. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

The purpose of each control in the Items to Compare group box is explained below:

•	Option Set (combo box). Type a name for a user-defined set of options, update the name of an existing option set using the standard editing keys or select a user-defined option set.

•	New. Saves the selected items as a named option set. ERwin saves the settings in the Options Set list under the name specified in the Option Set combo box.

•	Update. Updates an existing option set.

•	Delete. Deletes a saved option set.

•	Option Set (list box). Displays a complete list of the database items supported by the target database. Clear the box next to an item if you do not want ERwin to compare items of that type during synchronization. Select the check box if you want ERwin to compare items of that type. ERwin uses these settings to filter the display list in the Resolve Differences dialog. ERwin does not use these settings to filter items for import or export.

Controls in the Compare group box let you specify which tables in your database participate in the compare. These option settings affect both the items displayed in the differences list and the items that ERwin synchronizes or reverse engineers. For example, if you choose to compare your model with only those tables owned by the current user, ERwin ignores all other tables in the database during complete compare. All controls except the Model Objects Only check box are unavailable (dimmed) if you are comparing your model with a SQL script file, ModelMart diagram, or ER1/ERX file. The purpose of each control in the Compare group box is explained below.

•	System Objects. Select this check box to compare your model with both system and user tables. Clear the check box to compare your model with user tables only.

•	Tables/Views Owned By (group box). Choose one of the following options to filter the table and view comparison based on owner name:

•	All. Click this button to compare your model with all tables and views in the database, regardless of the owner.

•	Current User. Click this button to compare your model with only those the tables or views owned by the current user as entered in the User Name text box on the <Database> Connection dialog.

•	Owners (comma separated):. Click this button to filter the tables/views that ERwin will reverse engineer to the tables/views owned by the owner name(s) (separated by commas) specified in this box.

•	Model Objects Only. Select this check box if you want ERwin to disregard new objects in the target database, SQL script file, ModelMart diagram, or ER1/ERX file. Clear this check box if you want ERwin to detect new objects.

•	In. Click this button to open the Filter By Table Container dialog and select one or more tablespaces or databases that you want to reverse engineer (DB2/MVS only). See Selecting Tablespaces and Databases for Reverse Engineering and Complete Compare for more information.

The purpose of each control in the Match group box is explained below. Controls are unavailable (dimmed) if you are comparing your model with a SQL script file, ModelMart diagram, or ER1/ERX file.

•	Using Owner.  Select this check box if you want ERwin to match items in your model with items in the source database or file based on the owner name and other standard matching criteria. Clear the check box to match items based on standard matching criteria only. ERwin assigns table ownership for tables in your model using the name entered in the User Name text box on the <Database> Connection dialog. ERwin displays the Owner check box if your target database is DB2, SYBASE, SQL Server, Rdb, ORACLE, SQLBase, Watcom, SQL Anywhere, INGRES, AS/400, INFORMIX, PROGRESS, Red Brick, Teradata, Access, or Paradox.

•	Using Id. Select this check box if you want ERwin to match items in your model with items in the database based on the table ID number and other standard matching criteria. ERwin displays this option if your target database is SQL Server, SYBASE, Watcom, SQL Anywhere, or INFORMIX.

Note:	There are no options in the Match Using group box if your target database is Clipper, FoxPro, dBASE III or IV, or InterBase.

The purpose of each control in the Case Conversion of Physical Names group box is explained below:

•	None. Select this check box if you want ERwin to preserve the case of physical names exactly as they appear in the target database, SQL DDL script, or ER1/ERX file. ERwin imports the names without case conversion.

•	lower case. Select this check box if you want ERwin to change physical names to lowercase during import (for example, ERwin converts the table name Movie_copy to movie_copy).

•	UPPER CASE. Select this check box if you want ERwin to change physical names to uppercase during import (for example, ERwin converts the table name Movie_copy to MOVIE_COPY).

All remaining controls are explained below:

•	Table Filter. Displays the number of tables in the current model that you want to compare and the total number of tables in the model.

•	Filter. Click this button to open the Report Filter Editor. Using this editor you can select which tables in your model you want to compare with the database, SQL script, or ER1/ERX file. ERwin uses these settings to filter the display list in the Resolve Differences dialog and to filter the objects that are imported and exported.

The navigation controls in the dialog are explained below:

•	Next>. Opens the Update Model - Resolve Differences dialog. If you are not logged on to the target database, ERwin first displays the <Database> Connection dialog, then opens the Resolve Differences dialog after successfully logging on and reading the database structures.

•	Cancel. Cancels the Update Model process.

Related Topics

  Updating an ERwin Model Using Synchronization

  Filtering Items in the Set Options Dialog

  Using the Report Filter Editor

  Inferring Primary Key and Relationship Information

  Case Conversion of Logical and Physical Names


Resolving Differences When Updating a Model

When you click Next> in the Update Model - Set Options dialog, ERwin reads the database, DDL script, ERwin data model, or ModelMart diagram with which you want to sync, and attempts to match those database objects to the objects in your ERwin data model. When matching is complete, ERwin displays the Update Model - Resolve Differences dialog.

ERwin lists the differences between the active ERwin model on the left and the referenced database, script, or model on the right. By default, ERwin sets the action for all differences in the source database or file to Import [image]. If ERwin locates an item in the data model that is not in the source database or file, ERwin automatically sets the action for that item to Ignore [image]. Items that ERwin matches automatically are displayed on the same line in the Resolve Differences dialog.

 The tool buttons available on the Update Model - Resolve Differences dialog let you assign an action to each item in the differences list. If a button is unavailable (dimmed) it is not a valid action for the selected item. Each tool in the dialog is explained in the table below:

Tool	Description	Tool Usage
	Marks one or more selected items for import from the target database, DDL script, ModelMart diagram, or ER1/ERX file.	Select the item(s) that you want to import and click the IMPORT tool.
	Marks one or more selected items to be ignored.	Select the item(s) that you want ERwin to ignore and click the IGNORE tool.
	Marks one or more selected items for deletion.	Select the item(s) that you want ERwin to delete during import or export and click the DELETE tool.
	Lets you match two items that you want to compare, that were not matched by ERwin automatically.	When you select the Match tool, ERwin changes the cursor to a double-ended arrow. Click on an item in the left side of the list, then click on an item in the right side. ERwin moves the items so that they appear on the same line.
	Lets you break the match between an item in your model and an item in the target database, DDL script, ModelMart diagram, or ER1/ERX file.	Select the row containing the items that are incorrectly matched and click the UNMATCH tool. ERwin moves the selected items to different lines.
The Resolve Differences dialogs also include an action bar in center of the Differences list. Each item in the Differences list is associated with a symbol on the action bar that displays the action that you selected for that item (import, export, ignore, or delete). In addition to the default actions of import, export, and ignore, ERwin also shows mixed actions (import and export properties in the same item) and delete actions. See Resolve Differences Action Bar for more information on each type of action that ERwin displays on the action bar.

All other controls on the dialog are explained below:

•	Show Only Differences. Select this check box if you want ERwin to list only the differences between your model and the target database, DDL script, ModelMart diagram, or ER1/ERX file. Clear this check box to show all item similarities and differences.

•	Report. Click this button to open the Comparison Report Options dialog. See Generating a Comparison Report  for more information.

•	Preview. Click this button to open the Model Comparison Report Preview dialog.

•	< Back. Returns to the Update Model - Set Options dialog.

•	Next >. Opens the Update Model - Import Changes dialog.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  Updating an ERwin Model Using Synchronization

  Summary of DB Item Icons in the Differences List

  Expanding and Collapsing the Differences List

  Using the Resolve Differences Toolbar Buttons


Importing Changes to Update an ERwin Data Model

When you click Next> on the Update Model - Resolve Differences dialog, ERwin displays the Update Model - Import Changes dialog.

The purpose of each control in the Case Conversion of Logical Names group box is explained below: See Case Conversion of Logical and Physical Names for more information.

•	None. Select this check box if you want ERwin to create logical names that preserve the case of physical names exactly as they appear in the target database or DDL script. ERwin creates the logical names in the ERwin model without case conversion.

•	lower case. Select this check box if you want ERwin to create logical names in lowercase during reverse engineering (for example, ERwin converts the table name Movie_copy to movie copy).

•	UPPER CASE. Select this check box if you want ERwin to create logical names in uppercase during reverse engineering (for example, ERwin converts the table name Movie_copy to MOVIE COPY).

•	Mixed Case. Select this check box if you want ERwin to capitalize the first letter of each word in a logical name during reverse engineering (e.g., ERwin converts the table name ORDER_DETAIL to the Order Detail entity name.

•	Use Labels as Logical Names. This option is available for imports from an AS/400 system catalog or script file only. Select this check box if you want ERwin to use the labels in your AS/400 database or script file as logical names.

The purpose of each control in the If Table to Import Exists in Model group box is explained below:

•	Use Existing Table. Click this button to use an existing table if the table you are importing already exists in the model. For example, if you are importing a table into a new subject area and the table already exists in the <Main Subject Area>, ERwin does not duplicate the table. The table appears in the new subject area as a reference to the table in the <Main Subject Area>.

•	Create Duplicate Table. Click this button to create a duplicate table if the table you are importing already exists in the model.

The purpose of each control in the Infer group box is explained below: See Inferring Primary Key and Relationship Information for more information.

•	Primary Keys. Select this check box if you want ERwin to infer primary key columns for tables based on defined indexes.

•	Relations. Select this check box if you want ERwin to infer relationships between tables based on either primary key column names or defined indexes.

•	From. The purpose of each control in the From group box is explained below:

•	Names. Select this check box to infer relationships from the primary key column names. When selected, ERwin infers a relationship between two tables if all of the primary key columns of the parent are in the child table.

•	Indexes. Select this check box to infer relationships from the table indexes. When selected, ERwin infers the relationship between two tables only if the primary key columns of the parent table are in an index in the child table.

Note:	If the target database or DDL script file supports primary key and foreign key declarations, you do not need to use the options in the Infer group box.

The purpose of each control in the Views group box is explained below:

•	Import Base Tables. Check this option if you are importing a view and you want to import the tables referenced by the view (base tables). If you select this check box, ERwin parses the SQL code for each view and automatically creates a view relationship to each referenced table in your data model. Clear the check box if you want ERwin to import all view columns as user-defined expressions. ERwin maintains information about the referenced tables even if you choose not to import them. Later if you import one or more of the referenced tables, it automatically creates the view relationships to the imported tables.

All other controls in the Update Model - Import Changes dialog are explained below:

•	Start Import. Imports objects and definitions into your model from the target database, DDL script, ModelMart diagram, or ER1/ERX file. During the import process, ERwin displays messages about successful and unsuccessful import actions in the dialog list. You can print or save this message log after the import is complete, or when an import action is unsuccessful. Once ERwin completes the import, the button is changed to View Results.

•	View Results. Click this button to open the Import Summary dialog and view, print, or save the import message log after the import is complete. The buttons at the top of the Import Summary dialog let you save, print, find, cut, copy, and paste the contents of the preview window. See Toolbar Buttons in Preview Dialogs for more information on the buttons at the top of this dialog.

The navigation controls in the dialog are explained below:

•	<Back. Returns to the Resolve Differences dialog.

•	Finish. Closes the dialog.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  Updating an ERwin Model Using Synchronization

  To update an ERwin data model


To update an ERwin data model

1.	Click [image] and select the <Main Subject Area> or a different subject area that you want to update.

2.	Choose Update Model on the Tasks menu.

3.	Click the Database, Script File, ModelMart Diagram, or ER1/ERX File button.

•	If you click Script File or ER1/ERX File, you must also type the path and name of a file, or click the Browse button and select an existing path and file name, then click Open.

•	If you click ModelMart Diagram, you must also type the library and diagram name, or click the Browse button and select an existing library and diagram name, then click OK. This option is not available unless you are currently logged on to a ModelMart. More>

4.	Click Next>. ERwin compares the target server for the current data model with the target server for the database, script file, ModelMart diagram, or ERwin diagram.

5.	If they are different, you can choose to change the values in the in-memory copy of the database, script file, ERwin data model, or ModelMart diagram to those of the target server in the open model, keep the original values, or cancel the comparison and return to the Set Options dialog. Choose one of the following options:

•	Click Yes if you want ERwin to convert the values in the in-memory copy of the database, script file, ERwin data model, or ModelMart diagram to those of the target server of the source model as it retrieves the model into memory. ERwin does not alter the database or source file. The target servers of the source and target are now the same.

For example, if you set the target server for your ERwin model to SYBASE and then compare the model with a model for the ORACLE7 target server, ERwin converts the datatypes in the ORACLE7 model (e.g., CHAR(18)) to those of SYBASE (e.g., char(18)) and continues with the Update Model process.

•	Click No if you want to return to the Update Model - Set Options dialog and choose a different file.

6.	If they are the same (or if you select Yes when prompted to change the target to the current value before comparing), ERwin opens the selected file, as described below.

•	If you chose Database in Step 4, ERwin attempts to connect to the target server for your model. If you have not already logged on to the target server, ERwin displays the <Database> Connection dialog. Log on to the server to continue the Update Model process. More>

•	If you chose Script File in Step 4, ERwin parses the script.

•	If you chose ModelMart Diagram or ER1/ERX File in Step 4, ERwin reads in the information in the ModelMart diagram or ER1/ERX file.

While ERwin is reading the database, script file, ER1/ERX file, or ModelMart diagram that you selected, the Update Model Status dialog is displayed.

ERwin opens the Update Model - Resolve Differences dialog and automatically sets the default action for all detected differences to Import [image].

7.	Click Next>. ERwin opens the Update Model - Import Changes dialog.

8.	Click Start Import. When the import is complete, ERwin activates the dialog toolbar buttons.

9.	Click Finish.

10.	If you imported tables or views, you are prompted to choose whether you want to layout the model automatically or manually.

•	Click Yes if you want ERwin to automatically layout all the entities in your model.

•	Click No if you want to layout the model manually.


Altering a Database Using Synchronization

You can use ERwin’s Alter Database feature to compare an ERwin model with a target database, DDL script, ModelMart diagram, or ER1/ERX file. You can then use the differences that ERwin detects to:

•	Document changes by printing a report that lists the differences between models.

•	Update the database directly.

•	Generate a SQL DDL script to update your database. You can run the script exactly as generated by ERwin or change the script manually to implement additional changes.

Note:	When you choose the Alter Database option on the Tasks menu, you must have an existing database, script file, ModelMart diagram, or ERwin data model with which to compare. If you want to forward engineer a new database, use the Forward Engineer/Schema Generation option instead. See Forward Engineering for more information.

In the Alter Database process, ERwin allows one-way synchronization only. This means that you can update the database or generate a script file, but you cannot import changes in the database into the model. If you want to bidirectionally synchronize a model and a database or script file, use the Complete Compare option. See Using Complete Compare  for more information.

Related Topics

  Setting Options When Altering a Database

  Resolving Differences When Altering a Database

  Generating a Change Script to Alter a Database

  To generate a SQL DDL or DF alter script file

  To alter an existing database


Setting Options When Altering a Database

When you choose Alter Database on the Tasks menu, ERwin displays the Alter Database - Set Options dialog.

The purpose of each control in the Compare Current Model with group box is explained below:

•	Database. Click this button to compare the current model with an existing database.

•	Script File. Click this button to compare the current model with an existing SQL DDL script file. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	ModelMart Diagram. Click this button to compare the current model with a model stored in ModelMart. This option is available if you are currently logged on to ModelMart.

•	ER1/ERX File. Click this button to compare the current model with an existing ER1 or ERX file.

•	File Name. Type the name of the file (e.g., C:\ER\MOVIES.SQL) or ModelMart diagram (e.g., mylibrary..mymodel) that you want to compare with the current model. If you click the Browse button and select a file, ERwin displays the name of the file or diagram you selected in this text box. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	Browse.  ERwin enables the Browse button if you click the Script File, ER1/ERX File, or ModelMart Diagram button. When you click Browse, ERwin displays the Open dialog so that you can select a path and the name of an existing SQL DDL script, ER1/ERX file, or ModelMart model. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

The purpose of each control in the Items to Compare group box is explained below:

•	Option Set (combo box). Type a name for a user-defined set of options, update the name of an existing option set using the standard editing keys, or select a user-defined option set.

•	New. Saves the selected items as a named option set. ERwin saves the settings in the Options Set list under the name specified in the Option Set combo box.

•	Update. Updates an existing option set. ERwin saves the new settings and updates the option set name.

•	Delete. Deletes a saved option set.

•	Option Set (list box). Displays a complete list of the database items supported by the target database. Clear the check box next to an item if you do not want ERwin to compare items of that type during synchronization. Select the check box if you want ERwin to compare items of that type. ERwin uses these settings to filter the display list in the Resolve Differences dialog. ERwin does not use these settings to filter items for import or export.

Controls in the Compare group box let you specify which tables in your database participate in the compare. These option settings affect both the items displayed in the differences list and the items that ERwin synchronizes or reverse engineers. For example, if you choose to compare your model with only those tables owned by the current user, ERwin ignores all other tables in the database during complete compare. All controls except the Model Objects Only check box are unavailable (dimmed) if you are comparing your model with a SQL script file, ModelMart diagram, or ER1/ERX file. The purpose of each control in the Compare group box is explained below.

•	System Objects. Select this check box to compare your model with both system and user tables. Clear the check box (default) to compare your model with user tables only.

•	Tables/Views Owned By (group box).  Choose one of the following options to filter the table and view comparison based on owner name:

•	All. Click this button to compare your model with all tables and views in the database, regardless of the owner.

•	Current User. Click this button to compare your model with only those the tables or views owned by the current user as entered in the User Name text box on the <Database> Connection dialog.

•	Owners (comma separated):. Click this button to filter the tables/views that ERwin will reverse engineer to the tables/views owned by the owner name or names (separated by commas) specified in this box.

•	Model Objects Only. Select this check box if you want ERwin to disregard new items in the target database, SQL script file, ModelMart diagram, or ER1/ERX file. Clear the check box if you want ERwin to detect new items.

•	In. Click this button to open the Filter By Table Container dialog and select one or more tablespaces or databases that you want to reverse engineer. (DB2/MVS only) See Selecting Tablespaces and Databases for Reverse Engineering and Complete Compare for more information.

The purpose of each control in the Match group box is explained below. Controls are unavailable (dimmed) if you are comparing your model with a SQL script file, ModelMart diagram, or ER1/ERX file.

•	Using Owner.  Select this check box if you want ERwin to match items in your model with items in the source database or file based on the owner name and other standard matching criteria. Clear the check box to match items based on standard matching criteria only. ERwin assigns table ownership for tables in your model using the name entered in the User Name text box on the <Database> Connection dialog. ERwin displays the Owner check box if your target database is DB2, SYBASE, SQL Server, Rdb, ORACLE, SQLBase, Watcom, SQL Anywhere, INGRES, AS/400, INFORMIX, PROGRESS, Red Brick, Teradata, Access, or Paradox.

•	Using ID. Select this check box if you want ERwin to match items in your model with items in the database based on the table ID number and other standard matching criteria. ERwin displays this option if your target database is SQL Server, SYBASE, Watcom, SQL Anywhere, or INFORMIX.

Note:	The Match Using group box is not displayed if your target database is Clipper, FoxPro, dBASE III or IV, or InterBase.

All remaining controls are explained below:

•	Table Filter. Displays the number of tables in the current model that you want to compare and the total number of tables in the model.

•	Filter. Click this button to open the Report Filter Editor. Using this editor you can select which tables in your model you want to compare with the database, SQL script, or ER1/ERX file. ERwin uses these settings to filter the display list in the Resolve Differences dialog and to filter the items that are imported and exported.  See Using the Report Filter Editor for more information.  If you filter the tables you want to generate, you may also want to filter dangling relationships for those tables. See Filtering Dangling Relationships for more information.

•	Next>. Opens the Alter Database - Resolve Differences dialog. If you are not logged on to the target database, ERwin first displays the <Database> Connection dialog, then opens the Resolve Differences dialog after successfully logging on and reading the database structures.

•	Cancel. Closes the dialog and cancels any changes.

Note:	Although you can compare an ERwin model with another ERwin data model or ModelMart diagram in the Alter Database process, you can export changes to a target database or script file only. You cannot export changes to the ERwin model or ModelMart diagram.

Related Topics

  Altering a Database Using Synchronization

  Filtering Items in the Set Options Dialog

  Using the Report Filter Editor

  Inferring Primary Key and Relationship Information

  Case Conversion of Logical and Physical Names


Resolving Differences When Altering a Database

When you click Next> in the Alter Database - Set Options dialog, ERwin reads the database, DDL script, ModelMart diagram, or ER1/ERX file with which you want to sync, and attempts to match those database objects to the objects in your ERwin data model. When matching is complete, ERwin displays the Alter Database - Resolve Differences dialog.

ERwin lists the differences between the active ERwin model on the left and the referenced database, script, or model on the right. By default, ERwin sets the action for all differences in ERwin that are not in the target database or file to EXPORT [image]. If ERwin finds an item in the target database or file that has no equivalent in the open ERwin model, ERwin automatically sets the action for that item to IGNORE [image]. Items that ERwin matches automatically are displayed on the same line in the Resolve Differences dialog.

The tool buttons available on the Alter Database - Resolve Differences dialog let you assign an action to each item in the differences list. If a button is unavailable (dimmed) it is not a valid action for the selected item. Each tool in the dialog is explained in the table below:

Tool	Description	Tool Usage
	Marks one or more selected items for export to the target database or DDL script.	Select the item(s) that you want to export and click the EXPORT tool.
	Marks one or more selected items to be ignored.	Select the item(s) that you want ERwin to ignore click the IGNORE tool.
	Marks one or more selected items for deletion.	Select the item(s) that you want ERwin to delete during import or export and click the DELETE tool.
	Lets you match two items that you want to compare, that were not matched by ERwin automatically.	When you select the MATCH tool, ERwin changes the cursor to a double-ended arrow. Click on an item in the left side of the list, then click on an item in the right side. ERwin moves the items so that they appear on the same line.
	Lets you break the match between an item in your model and an item in the target database, DDL script, ModelMart diagram, or ER1/ERX file.	Select the row containing the items that do not match and click the UNMATCH tool. ERwin moves the selected items to different lines.
The Resolve Differences dialogs also include an action bar in the center of the Differences list. Each item in the Differences list is associated with a symbol on the action bar that displays the action that you selected for that item (import, export, ignore, or delete). In addition to the default actions of import, export, and ignore, ERwin also shows mixed actions (import and export properties in the same item) and delete actions. See Resolve Differences Action Bar for more information on each type of action that ERwin displays on the action bar.

All other controls on the dialog are explained below:

•	Show Only Differences. Select this check box if you want ERwin to list only the differences between your model and the target database, DDL script, ModelMart diagram, or ER1/ERX file. Clear this check box to show all item similarities and differences.

•	Report. Click this button to open the Comparison Report Options dialog. See Generating a Comparison Report for more information.

•	Preview. Click this button to open the Preview <database> dialog.

•	< Back. Returns to the Alter Database - Set Options dialog.

•	Next >. Opens the Alter Database - Export Changes dialog.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  Altering a Database Using Synchronization

  Using the Resolve Differences Toolbar Buttons

  Summary of DB Item Icons in the Differences List

  Expanding and Collapsing the Differences List


Generating a Change Script to Alter a Database

When you click Next> on the Alter Database - Resolve Differences dialog, ERwin displays the Alter Database - Export Changes dialog.

The SQL DDL script generated by ERwin appears in the dialog window. You can use the scroll bars on the window to preview the script, and you can edit the script directly using the standard keyboard editing keys. You can also use the tools at the top of the dialog to save, print, and edit the SQL DDL change script. See Toolbar Buttons in Preview Dialogs  for more information on the buttons at the top of this dialog.

The purpose of each control in the Alter Database - Export Changes dialog is explained below:

•	Reset. Restores the contents of the export script window to its original state. ERwin activates the Reset button when you edit the export script in the Export Changes dialog window or when a statement fails during execution of the change script.

•	Abort. Cancels the export at the point of failure. ERwin activates the Abort button if it encounters an error during execution of the export script.

•	Start Export. Click this button to begin exporting items and definitions from your model to the target database. During the export process, ERwin displays messages about successful and unsuccessful export actions in the dialog list. You can print or save this message log after the export is complete, or when an export is unsuccessful.

Note:	The maximum amount of information that can be contained in the log is 32 KB (32,000 bytes). If your log is longer than 32 KB, only the last 32 KB of the log text is available to view, print, or save.

•	Display Warnings. Select this check box if you want ERwin to include warning messages in the export script.

•	Display Changes. Select this check box if you want ERwin to include change messages in the export script.

•	Display Impact. Select this check box if you want ERwin to include impact analysis information in the export script.

•	Stop If Failure. Select this check box if you want ERwin to pause the export process if an action is unsuccessful. Clear this check box if you want ERwin to continue the export without pausing at each error.

•	Gen Options. Click this button to open the <Database> Schema Generation Report and specify which table, index, column, or other properties that you want ERwin to apply when creating new database objects. See Using the Schema Generation Editor for more information on the controls on this dialog.

•	Save Data. Select this check box to open the Data Preservation Options dialog. This button is available if any statement in the SQL change script is potentially destructive to data (for example, a statement that changes a column datatype from character to date). See Setting Data Preservation Options for more information.

•	< Back. Returns to the Alter Database - Resolve Differences dialog.

•	Cancel. Closes the dialog and cancels any changes.

•	Finish. Closes the dialog.

Related Topics

  Altering a Database Using Synchronization

  To generate a SQL DDL or DF alter script file

  To alter an existing database


To generate a SQL DDL or DF alter script file

1.	Open an existing ERwin or ModelMart data model.

2.	Click [image] and select the <Main Subject Area> or a different subject area that you want to use to update your database or create an alter script.

3.	Click Alter Database on the Tasks menu.

4.	Click the Database, Script File, ModelMart Diagram, or ER1/ERX File button.

•	If you click Script File or ER1/ERX File, you must also type the path and name of a file, or click the Browse button and select an existing path and file name, then click Open.

•	If you click ModelMart, you must also type the library and diagram name, or click the Browse button and select an existing library and diagram name, then click OK. This option is unavailable unless you are currently logged on to a ModelMart. More>

Note:	In order to properly maintain database integrity if you are comparing your model with a SQL script or ER1/ERX model, be sure to include all dependent tables in the Differences list. See Filtering Dangling Relationships for more information.

5.	Click Next>. ERwin compares the target server for the current data model with the target server for the database, script file, ModelMart diagram, or ERwin diagram.

6.	If they are different, ERwin lets you choose to change the values in the in-memory copy of the database, script file, ERwin data model, or ModelMart diagram to those of the target server in the open model, keep the original values, or cancel the comparison and return to the Set Options dialog. Choose one of the following options:

•	Click Yes if you want ERwin to convert the values in the in-memory copy of the database, script file, ERwin data model, or ModelMart diagram to those of the target server of the source model as it retrieves the model into memory. ERwin does not alter the database or source file. The target servers of the source and target are now the same.

•	For example, if you set the target server for your ERwin model to SYBASE and then compared the model with a model for the ORACLE7 target server, ERwin converts the datatypes in the ORACLE7 model (e.g., CHAR(18)) to those of SYBASE (e.g., char(18)) and continues with the Alter Database process.

•	Click No if you want to return to the Alter Database - Set Options dialog and choose a different file.

7.	If they are the same (or if you select Yes when prompted to change the target to the current value before comparing), ERwin opens the selected file, as described below.

•	If you chose Database in Step 4, ERwin attempts to connect to the target server for your model. If you have not already logged on to the target server, ERwin displays the <Database> Connection dialog. Log on to the server to continue the Alter Database process. More>

•	If you chose Script File in Step 4, ERwin parses the script.

•	If you chose ModelMart Diagram or ER1/ERX File in Step 4, ERwin reads in the information in the ModelMart diagram or ER1/ERX file.

While ERwin is reading the database, script file, ER1/ERX file, or ModelMart diagram that you selected, the Alter Database Status dialog is displayed.

ERwin opens the Alter Database - Resolve Differences dialog and automatically sets the default action for all detected differences to Export [image].

8.	Click Next>. If your changes to the database can cause data loss or other problems in the database (for example, changing a column from a long datatype to a shorter one), ERwin generates a warning message for the action and displays it in the ALTER Script Warnings dialog. Click Close to proceed with the Alter Database process.

	Click this button to read important caution information prior to executing the next step in this procedure
5.	ERwin opens the Alter Database - Export Changes dialog.

6.	If the SQL change script in the Export list includes an INSERT SELECT statement that alters table data, you can click the Save Data button to view or override default data preservation settings for updated tables. See Setting Data Preservation Options for more information.

7.	Click [image].

8.	Type a valid filename, select a path, and click OK.

9.	Click Finish.


To alter an existing database

1.	To update an existing database, first generate an alter script for the database. More>

	Click this button to read important caution information prior to executing the next step in this procedure
2.	In the Alter Database - Export Changes dialog, click Start Export.

3.	If you compared your model to a script file, ERwin data model or ModelMart diagram, ERwin asks you to confirm that you want to update the database. Choose one of the following options:

•	Click Yes to continue.

•	Click No to cancel the database update.

4.	If you have not already logged on to the target database, ERwin displays the <Database> Connection dialog. Complete the log on steps. More>

ERwin exports all changes from your model to the target database.

5.	When export is complete, click Finish.


Caution

Read the alter script carefully before submitting it to the database. It is especially important to read and understand all warning messages. Make a database backup of the involved database items before executing any generated script.

ERwin issues warnings for all changes that affect data integrity. For example, if your database lets you create foreign key or CHECK constraints without applying them to existing data, your data may not conform to data integrity rules after running the alter script.

If you modify a table that is referenced by stored procedures, triggers, and views, the referencing items may be invalidated or dropped (for DB2/MVS and some other DBMSs) depending on the type of modification. ERwin does not recompile or recreate these items automatically.


Using Complete Compare

When you choose Complete Compare on the Tasks menu, ERwin displays a series of dialogs that guide you through the process of importing model information into ERwin and exporting changes to a database or script file. The steps include:

1.	Setting complete compare options. See Setting Options for Complete Compare  for more information.

2.	Resolving differences and selecting items you want to import, export, or ignore. See Resolving Differences During Complete Compare  for more information.

3.	Importing changes into your model. See Importing Changes into a Model During Complete Compare  for more information.

4.	Setting data preservation options and exporting changes to a database or script file. See Setting Data Preservation Options  and Exporting Model Changes to a Database or DDL Script File  for more information.


Setting Options for Complete Compare

When you choose Complete Compare on the Tasks menu, ERwin opens the Complete Compare - Set Options dialog.

Each control in the Compare Current Model With group box is explained below:

•	Database. Click this button to compare the current model with an existing database.

•	Script File. Click this button to compare the current model with an existing SQL DDL script file. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	ModelMart Diagram. Click this button to compare the current model with a model stored in ModelMart. This option is available if you are currently logged on to ModelMart.

•	ER1/ERX File. Click this button to compare the current model with an existing ER1 or ERX file.

•	File Name. Type the name of the file (for example, C:\ER\MOVIES.SQL) or ModelMart diagram (for example, mylibrary..mymodel) that you want to compare with the current model. If you click the Browse button and select a file, ERwin automatically displays the name of the file or diagram you selected in this text box. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	Browse.  ERwin enables the Browse button if you click the Script File, ER1/ERX File, or ModelMart button. When you click Browse, ERwin displays the Open dialog so that you can select a path and the name of an existing SQL DDL script, ER1/ERX file, or ModelMart model. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

Each control in the Items to Compare group box is explained below:

•	Option Set. Enter a name for a user-defined set of options, update the name of an existing option set using the standard editing keys, or select a user-defined option set.

•	New. Saves the selected items as a named option set. ERwin saves the settings in the Options Set list box under the name specified in the Option Set combo box.

•	Update. Updates an existing option set. ERwin saves the new settings and updates the option set name.

•	Delete. Deletes a saved option set.

•	Option Set. Displays a complete list of the database items supported by the target database. Clear the check box next to an item if you do not want ERwin to compare items of that type during synchronization. Select the check box if you want ERwin to compare items of that type. ERwin uses these settings to filter the display list in the Resolve Differences dialog. ERwin does not use these settings to filter items for import or export.

Controls in the Compare group box let you specify which tables in your database participate in the compare. These option settings affect both the items displayed in the differences list and the items that ERwin synchronizes or reverse engineers. For example, if you choose to compare your model with only those tables owned by the current user, ERwin ignores all other tables in the database during complete compare. All controls except the Model Objects Only check box are unavailable (dimmed) if you are comparing your model with a SQL script file, ModelMart diagram, or ER1/ERX file. The purpose of each control in the Compare group box is explained below.

•	System Objects. Select this check box to compare your model with both system and user tables. Clear the check box (default) to compare your model with user tables only.

•	Tables Owned By (group box).  Choose one of the following options to filter the table and view comparison based on owner name:

•	All (default). Click this button to compare your model with all tables and views in the database, regardless of the owner.

•	Current User. Click this button to compare your model with only those the tables or views owned by the current user as entered in the User Name text box on the <Database> Connection dialog.

•	Owners (comma separated).  Click this button to filter the tables/views that ERwin will reverse engineer to the tables/views owned by the owner name or names (separated by commas) specified in this box.

•	Model Objects Only. Select this check box if you want ERwin to disregard new items in the target database, SQL script file, ModelMart diagram, or ER1/ERX file. Clear the check box if you want ERwin to detect new items.

•	In. Click this button to open the Filter By Table Container dialog and select one or more tablespaces or databases that you want to reverse engineer. (DB2/MVS only) See Selecting Tablespaces and Databases for Reverse Engineering and Complete Compare for more information.

Each control in the Match group box is explained below. Controls are unavailable (dimmed) if you are comparing your model with a SQL script file, ModelMart diagram, or ER1/ERX file.

•	Using Owner.  Select this check box if you want ERwin to match items in your model with items in the source database or file based on the owner name and other standard matching criteria. Clear the check box to match items based on standard matching criteria only. ERwin assigns table ownership for tables in your model using name entered in the User Name text box on the <Database> Connection dialog. ERwin displays the Owner check box if your target database is DB2, SYBASE, SQL Server, Rdb, ORACLE, SQLBase, Watcom, SQL Anywhere, INGRES, AS/400, NetWare SQL, INFORMIX, PROGRESS, Red Brick, Teradata, Access, or Paradox.

•	Using Id. Select this check box if you want ERwin to match items in your model with items in the database based on the table ID number and other standard matching criteria. ERwin displays this option if your target database is SQL Server, SYBASE, Watcom, SQL Anywhere, or INFORMIX.

Note:	The Match Using group box is not displayed if your target database is Clipper, FoxPro, dBASE III or IV, or InterBase.

Each control in the Case Conversion of Physical Names group box is explained below:

•	None. Click this button if you want ERwin to preserve the case of physical names exactly as they appear in the target database, SQL DDL script, or ER1/ERX file. ERwin imports the names without case conversion.

•	lower case. Click this button if you want ERwin to change physical names to lowercase during synchronization (e.g., ERwin converts the table name Movie_copy to movie_copy).

•	UPPER CASE. Click this button if you want ERwin to change physical names to uppercase during synchronization (e.g., ERwin converts the table name Movie_copy to MOVIE_COPY).

All remaining controls are explained below:

•	Table Filter. Displays the number of tables in the current model that you want to compare and the total number of tables in the model.

•	Filter. Click this button to open the Report Filter Editor. Using this editor you can select which tables in your model you want to compare with the database, SQL script, or ER1/ERX file. ERwin uses these settings to filter the display list in the Complete Compare - Resolve Differences dialog and to filter the items that are imported and exported. If you filter the tables you want to generate, you may also want to filter dangling relationships for those tables. See Filtering Dangling Relationships for more information.

The navigation controls in the dialog are explained below:

•	Next>. Opens the Complete Compare - Resolve Differences dialog. If you are not logged on to the target database, ERwin first displays the <Database> Connection dialog, then opens the Resolve Differences dialog after successfully logging on and reading the database structures.

•	Cancel. Cancels the Complete Compare process.

Related Topics

  Filtering Items in the Set Options Dialog

  Using the Report Filter Editor

  Inferring Primary Key and Relationship Information

  Case Conversion of Logical and Physical Names

  Resolving Differences During Complete Compare

  Importing Changes into a Model During Complete Compare

  Exporting Model Changes to a Database or DDL Script File


Resolving Differences During Complete Compare

When you click Next> in the Complete Compare - Set Options dialog, ERwin reads the database, DDL script, ERwin data model, or ModelMart diagram with which you want to compare, and attempts to match those database items to the items in your ERwin data model. When matching is complete, ERwin displays the Complete Compare - Resolve Differences dialog.

ERwin lists the differences between the active ERwin model on the left and the referenced database, script, or model on the right. By default, ERwin sets the action for all differences in the source database or file to Ignore [image]. Items that ERwin matches automatically are displayed on the same line in the Resolve Differences dialog.

The tool buttons available on the Update Model - Resolve Differences dialog let you assign an action to each item in the differences list. If a button is unavailable (dimmed) it is not a valid action for the selected item. Each tool in the dialog is explained in the table below:

Tool	Description	Tool Usage
	Marks one or more selected items for export to the target database or DDL script.	Select the item(s) that you want to export and click the Export tool.
	Marks one or more selected items for import from the target database, DDL script, ModelMart diagram, or ER1/ERX file.	Select the item(s) that you want to import and click the Import tool.
	Marks one or more selected items to be ignored.	Select the item(s) that you want ERwin to ignore click the Ignore tool.
	Marks one or more selected items for deletion.	Select the item(s) that you want ERwin to delete during import or export and click the Delete tool.
	Lets you match two items that you want to compare, that were not matched by ERwin automatically.	When you select the Match tool, ERwin changes the cursor to a double-ended arrow. Click on an item in the left side of the list, then click on an item in the right side. ERwin moves the items so that they appear on the same line.
	Lets you break the match between an item in your model and an item in the target database, DDL script, ModelMart diagram, or ER1/ERX file.	Select the row containing the items that are incorrectly matched and click the Unmatch tool. ERwin moves the selected items to different lines.

The Resolve Differences dialogs also include an action bar in center of the Differences list box. Each item in the Differences list box is associated with a symbol on the action bar that displays the action that you selected for that item (import, export, ignore, or delete). In addition to the default actions of import, export, and ignore, ERwin also shows mixed actions (import and export properties in the same item) and delete actions. See Resolve Differences Action Bar for more information on each type of action that ERwin displays on the action bar.

All other controls on the dialog are explained below:

•	Show Only Differences. Select this check box if you want ERwin to list only the differences between your model and the target database, DDL script, ModelMart diagram, or ER1/ERX file. Clear the check box to show all item similarities and differences.

•	Report. Click this button to open the Comparison Report Options dialog. See Generating a Comparison Report  for more information.

•	Preview. Click this button to open the Report Preview dialog.

•	< Back. Returns to the Complete Compare - Set Options dialog.

•	Next >. Opens the Complete Compare - Import Changes dialog if any items are selected for import, otherwise, ERwin opens the Complete Compare - Export Changes dialog.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  Expanding and Collapsing the Differences List

  Summary of DB Item Icons in the Differences List

  Using the Resolve Differences Toolbar Buttons

  Examining and Changing Item Properties

  Setting Options for Complete Compare

  Importing Changes into a Model During Complete Compare

  Exporting Model Changes to a Database or DDL Script File


Importing Changes into a Model During Complete Compare

If you choose to import one or more items or definitions from the target database, DDL script, ModelMart diagram, or ER1/ERX file into your ERwin model, when you click the Next> button in the Complete Compare - Resolve Differences dialog, ERwin opens the Complete Compare - Import Changes dialog.

Each control in the Case Conversion of Logical Names group box is explained below:

•	None. Select this check box if you want ERwin to create logical names that preserve the case of physical names exactly as they appear in the target database or DDL script. ERwin creates the logical names in the ERwin model without case conversion.

•	lower. Select this check box if you want ERwin to create logical names in lowercase during reverse engineering (e.g., ERwin converts the table name Movie_copy to movie copy).

•	UPPER. Select this check box if you want ERwin to create logical names in uppercase during reverse engineering (e.g., ERwin converts the table name Movie_copy to MOVIE COPY).

•	Mixed. Select this check box if you want ERwin to capitalize the first letter of each word in a logical name during reverse engineering (e.g., ERwin converts the table name ORDER_DETAIL to the Order Detail entity name.

•	Use Labels as Logical Names. This option is available for imports from an AS/400 system catalog or script file only. Select this check box if you want ERwin to use the labels in your AS/400 database or script file as logical names.

The purpose of each control in the If Table to Import Exists in Model group box is explained below:

♦	Use Existing Table. Click this button to use an existing table if the table your are importing already exists in the model.
For example, if you are importing a table into a new subject area and the table already exists in the Main Subject Area, ERwin does not duplicate the table in the new subject area but references the table in the Main Subject Area.

♦	Create Duplicate Table. Click this button to create a duplicate table if the table you are importing already exists in the model.

The purpose of each control in the Infer group box is explained below:

•	Primary Keys. Select this check box if you want ERwin to infer primary key columns for tables based on defined indexes.

•	Relations. Select this check box if you want ERwin to infer relationships between tables based on either primary key column names or defined indexes.

•	From. The purpose of each control in the From group box is explained below:

•	Names. Select this check box to infer relationships from the primary key column names. When selected, ERwin infers a relationship between two tables if all of the primary key columns of the parent are in the child table.

•	Indexes. Select this check box to let ERwin infer relationships from the table indexes. When selected, ERwin infers the relationship between two tables only if the primary key columns of the parent table are in an index in the child table.

Note:	If the target database or DDL script file supports primary key and foreign key declarations, you do not need to use the options in the Infer from Indexes group box.

The purpose of each control in the Views group box is explained below:

♦	Import Base Tables. Select this check box if you are importing a view and you want to import the tables referenced by the view (base tables). If you select this check box, ERwin parses the SQL code for each view and automatically creates a view relationship to each referenced table in your data model. Clear the check box if you want ERwin to import all view columns as user-defined expressions. ERwin maintains information about the referenced tables even if you choose not to import them. Later if you import one or more of the referenced tables, it automatically creates the view relationships to the imported tables.

All other controls in the Complete Compare - Import Changes dialog are explained below:

•	Start Import. Imports items and definitions into your model from the target database, DDL script, ModelMart diagram, or ER1/ERX file. During the import process, ERwin displays messages about successful and unsuccessful import actions in the dialog list box. You can print or save this message log after the import is complete, or when an import action is unsuccessful. Once ERwin completes the import, the button is changed to View Results.

•	View Results. Click this button to open the Import Summary dialog and view, print, or save the import message log after the import is complete. The buttons at the top of the dialog let you save, print, find, cut, copy, and paste the contents of the preview window. See Toolbar Buttons in Preview Dialogs for more information on the buttons at the top of this dialog.

The navigation controls in the dialog are explained below:

•	<Back. Returns to the Complete Compare - Resolve Differences dialog.

•	Next. Updates your model and opens the Complete Compare - Export Changes dialog if any items are selected for export.

•	Finish. Closes the dialog. This option is only available if no items in the Differences list were selected for export.

•	Cancel. Cancels the Complete Compare process.

Related Topics

  Inferring Primary Key and Relationship Information

  Case Conversion of Logical and Physical Names

  Setting Options for Complete Compare

  Resolving Differences During Complete Compare

  Exporting Model Changes to a Database or DDL Script File


Exporting Model Changes to a Database or DDL Script File

The Complete Compare - Export Changes dialog lets you set additional options for database generation and complete the export of changes to the target database or to a SQL DDL script file. ERwin opens the Complete Compare - Export Changes dialog when you select one or more items for export to the target database and choose Next> in the:

•	Complete Compare - Resolve Differences dialog (if you have not selected any items for import).

•	Complete Compare - Import Changes dialog (if you have selected items for import and other items for export).

The SQL DDL script generated by ERwin appears in the dialog window. You can use the scroll bars on the window to preview the script, and you can edit the script directly using the standard keyboard editing keys. You can also use the tools at the top of the dialog to save, print, and edit the SQL DDL change script. See Toolbar Buttons in Preview Dialogs for more information on the buttons at the top of this dialog.

Note:	You should read the export script carefully before submitting it to the database. It is especially important to read and understand all warning messages. Make a database backup of the involved database items before executing any generated script.

Each control in the Complete Compare - Export Changes dialog is explained below:

•	Reset. Restores the contents of the export script window to its original state. ERwin activates the Reset button when you edit the export script in the Export Changes dialog window or when a statement fails during execution of the change script.

•	Abort. Cancels the export at the point of failure. ERwin activates the Abort button if it encounters an error during execution of the export script.

•	Start Export. Click this button to begin exporting items and definitions from your model to the target database. During the export process, ERwin displays messages about successful and unsuccessful export actions in the dialog list box. You can print or save this message log after the export is complete, or when execution of a statement is unsuccessful.

•	Display Warnings. Select this check box if you want ERwin to include warning messages in the export script. The default is selected.

•	Display Changes. Select this check box if you want ERwin to include change messages in the export script. The default is selected.

•	Display Impact. Select this check box if you want ERwin to include impact analysis information in the export script. The default is selected.

•	Stop If Failure. Select this check box if you want ERwin to pause the export process if execution of a statement is unsuccessful. Clear the check box if you want ERwin to continue the export without pausing at each error.

•	Gen Options. Click this button to open the <Database> Schema Generation Report and specify which table, index, column, or other properties that you want ERwin apply when creating new database objects. See Using the Schema Generation Editor for more information on the controls on this dialog.

If you filter the tables you want to generate in the <Database> Schema Generation Report, you may also want to filter dangling relationships for those tables. See Filtering Dangling Relationships for more information.

•	Save Data. Select this check box to open the Data Preservation Options dialog. ERwin activates this button if any statement in the SQL change script is potentially destructive to data (e.g., a statement that changes a column datatype from character to date). See Setting Data Preservation Options for more information.

•	< Back. Returns to the Complete Compare - Import Changes dialog if you selected items for import. If you click < Back after importing changes, ERwin can go back to the Import Changes dialog, but not to the Resolve Differences dialog.

Returns to the Complete Compare - Resolve Differences dialog if no items were selected for import.

•	Cancel. Cancels the Complete Compare - Export Changes process. If you cancel after importing changes using the Complete Compare - Import Changes dialog, ERwin cancels the export process but does not undo changes to your model.

•	Finish. Closes the dialog.

Related Topics

  Summary of Alter Statement Restrictions

  Setting Options for Complete Compare

  Resolving Differences During Complete Compare

  Importing Changes into a Model During Complete Compare


Setting Data Preservation Options

When ERwin generates the statements to update your database, it first attempts to create an ALTER TABLE statement to implement the changes. For example, ERwin typically generates an ALTER TABLE statement to implement a change to a column datatype from a shorter field to a longer field of the same type.

However, ERwin cannot always make a modification using an ALTER TABLE statement. Some databases, for example, do not support datatype modifications using a SQL statement. In this case, ERwin generates DROP TABLE and CREATE TABLE statements for the affected table to implement the change. ERwin also generates the DROP TABLE and CREATE TABLE statements if the statement has the potential to cause a loss of data, such as when it converts a column from a longer datatype to a shorter one. When it creates a temporary table before executing the DROP TABLE/CREATE TABLE statements, ERwin ensures that a copy of the pre-change data exists in case of data loss.

The Data Preservation Options dialog lets you review and modify the SQL statement for tables that are dropped and recreated during export. When you click the Save Data button on the Complete Compare - Export Changes dialog, ERwin opens the Data Preservation Options dialog.

ERwin lists all tables that appear in DROP TABLE and CREATE TABLE statements in the From Table/To Table list box at the top of the dialog. To view the settings for a particular table, click on the table name in the list box.

To view the SQL statement for the selected table, click the Preview SQL button. You cannot change the SQL statement during preview, but you can change the conversion function associated with a column by entering or changing the default statement in the Function text box using the correct SQL syntax for the selected target server. You can also add a WHERE clause to the generated SQL statement using the Where Condition text box. Note that ERwin does not perform any SQL syntax checking for user-specified functions.

Each control in the Data Preservation Options dialog is explained below:

•	From Table/To Table. Click a table name (e.g., MOVIE_COPY —>MOVIE_COPY) in the From Table/To Table list box to display the column names for a table in the source model (From Table) and a corresponding altered table in the target database, DDL script, ModelMart diagram, or ER1/ERX file (To Table) in the From Column/To Column list box.

•	Preview SQL. Click this button to preview the INSERT SELECT SQL statement that ERwin generates for the current table. This statement is executed when data is reloaded from the temporary table and is used to modify the table columns and column properties and preserve data if you have altered column properties.

Each options in the Data Preservation Definition group box is explained below:

•	Where Condition. Type a valid WHERE clause for your target database. ERwin inserts the WHERE clause into the SELECT statement that affects the current table.

•	From column. ERwin displays each column in the source table under the From column heading. The list contains a dash (-) when the source table does not include a column that appears in the target table.

•	To column. ERwin displays each column in the target table under the To column heading. ERwin marks the columns that are affected by the export with an asterisk (*). The list contains a dash (-) when the target table does not include a column that appears in the source table.

•	Conversion Function. ERwin displays information about how the export affects the current column. If you change the datatype for the column, for example, ERwin displays the INSERT SELECT statement clause (e.g., CONVERT) that ERwin will use to modify the datatype for the current column when it reloads the table from the temporary table. The list entry for the current column is blank if you are adding a column to the target table. The list entry for the current column includes the column name if the definition of the source and target columns is identical.

The From and To group boxes provide read-only details, including the column name, datatype, null option, and default for the current column.

•	Function. Enter a valid SQL data transformation function for your target database. ERwin includes the function statement in the INSERT SELECT statement for the current table. This statement is executed when ERwin reloads the table from the temporary table. The function can include:

•	Clauses, to set the default value or an initial value.

•	Conversion, string manipulation, or system functions to support preservation of data in the column. For example, you can use standard SQL functions to choose which portion of data you want to save, to split a column into two or more columns, or to merge columns together to one column.

•	DO NOT preserve data. Select this check box if you do not want ERwin to save the data in the current table (unload/reload the table) during alteration.

•	DROP temp table. Select this check box if you want ERwin to automatically issue a DROP TABLE statement for temporary tables after it reloads modified table. Clear the check box to keep the temporary tables in the database.

Note:	If the create and reload is not successful, the temporary table is not dropped.

•	Update. Saves a user-defined function for this column. ERwin lists the new function in the column list box for the current column.

•	Reset. Resets the Function text box. ERwin displays the text in the Function text box as it appeared prior to editing.

•	Default. Redisplays the default function for this column in the Function text box.

Related Topics

  Summary of Alter Statement Restrictions

  Setting Options for Complete Compare

  Resolving Differences During Complete Compare

  Importing Changes into a Model During Complete Compare

  Exporting Model Changes to a Database or DDL Script File


Summary of Alter Statement Restrictions

Statement Type	DBMS	Restriction
INSERT SELECT	All	You must include a default value or initial value for all new columns that are NOT NULL, otherwise the INSERT SELECT statement fails.
INSERT SELECT	ORACLE	The LONG/LONG VARCHAR datatype cannot be used in an INSERT SELECT statement. As a result, reloading data from a temporary table that contains a column with a LONG/LONG VARCHAR datatype fails.
FK and/or ADD CHECK	All	If your database lets you create foreign key or CHECK constraints without applying them to existing data, your data may not conform to data integrity rules after running the modify script. ERwin issues warnings for changes that can affect data integrity.
ADD CHECK	SQL Server, SYBASE	In some database systems, you cannot modify a column CHECK constraint using an alter statement. The ALTER ADD CHECK statement can only add CHECK constraints at the table level. In this case, when you add a column CHECK constraint, ERwin generates DROP and CREATE statements for the table that include the new CHECK constraint. To avoid dropping and recreating the table, you can specify the constraint at the table level.
FK	DB2/MVS	If you add a foreign key to a table with data, DB2/MVS sets the tablespace containing the table to the check pending state. You must run the CHECK utility to reset the tablespace status before using the table.
ALTER TABLE	INFORMIX	Although INFORMIX supports moving columns within a table using the ALTER TABLE statement, ERwin moves columns using DROP TABLE/CREATE TABLE statements.


Filtering Items in the Set Options Dialog

ERwin lets you filter the types of database items that you want to synchronize or reverse engineer using the Option Set list box in the Set Options dialogs.

You can select or clear an item in the Option Set list box to include or exclude items of that type during reverse engineering or synchronization. The settings in the Option Set list box affect the items that ERwin synchronizes or reverse engineers. For example, if you clear the check box next to an item such as Table or Validation, ERwin does not reverse engineer items of that type. The items you select also determine which items are compared during synchronization. ERwin compares only those items that are selected in the Option Set list box and displays the differences in selected items in the Resolve Differences dialog.

ERwin lets you name and save the settings in the Option Set list box, so that you can choose the settings for your environment once and reuse them the next time you synchronize the model. ERwin includes one predefined item set called the Default Option Set, which automatically selects all items in the Option Set list box.

To create a new option set, type a new name in the Option Set combo box, select or clear check boxes next to items in the Option Set list, and click New. The next time you synchronize the model, you can click the down arrow on the Option Set combo box and select the settings by name.

Note:	During synchronization, the items selected or cleared in the Option Set list box affect the items displayed in the Resolve Differences dialog, but do not affect whether or not the item will be forward or reverse engineered. For example, if you deselect the Column item, ERwin does not display column differences in the Resolve Differences list. However, if you import the table differences, ERwin automatically imports the table’s columns even though Column is deselected.

Related Topics

  To filter items compared in the Set Options dialogs

  To create an option set in the Set Options dialogs

  To modify an option set in the Set Options dialogs

  To delete an option set in the Set Options dialogs


To filter items compared in the Set Options dialogs

1.	Click Reverse Engineer, Update Model, Alter Database, or Complete Compare on the Tasks menu. ERwin displays the Set Options dialog.

2.	In the Option Set list box, choose one or more of the following options:

•	To compare or reverse engineer database items of that type, select the check box next to the item.

•	To ignore items of that type, clear the check box next to the item.

3.	Click Next >. ERwin uses the options you selected to:

•	Create the Resolve Differences list.

•	Filter the database items that it reads into the new model (reverse engineering).


To create an option set in the Set Options dialogs

1.	Click Reverse Engineer, Update Model, Alter Database, or Complete Compare on the Tasks menu. ERwin displays the Set Options dialog.

2.	Type a name for the new option set in the Option Set combo box, then click New.

3.	In the Option Set list box, choose one or more of the following options:

•	To compare or reverse engineer database items of that type, select the check box next to the item.

•	To ignore items of that type, clear the check box next to the item.

ERwin saves the settings in the Option Set list box under the name you specified.


To modify an option set in the Set Options dialogs

1.	Click Reverse Engineer, Update Model, Alter Database, or Complete Compare on the Tasks menu. ERwin displays the Set Options dialog.

2.	Select the option set you want to modify in the Option Set combo box.

3.	In the Option Set list box, choose one or more of the following options:

•	To compare or reverse engineer database items of that type, select the check box next to the item.

•	To ignore items of that type, clear the check box next to the item.

4.	To modify the name of the option set, use the standard editing keys to edit name in the Option Set combo box, then click Update. ERwin updates the name of the selected option set.


To delete an option set in the Set Options dialogs

1.	Click Reverse Engineer, Update Model, Alter Database, or Complete Compare on the Tasks menu. ERwin displays the Set Options dialog.

2.	Select the option set you want to delete in the Option Set combo box.

3.	Click Delete. ERwin deletes the selected option set from the list of predefined settings in the Option Set combo box.


Using the Report Filter Editor

The Set Options dialogs and the Schema Generation Report Editor let you select a subset of the tables in your model for synchronization or forward engineering. When you click the Filter button, ERwin displays the Report Filter Editor.

By default, ERwin compares or forward engineers all the tables in the current subject area. Tables that ERwin will compare or forward engineer are listed in the Table Filter list box; you can move tables that you do not want to compare or forward engineer to the Table Pool.

Each control in the Report Filter Editor is explained below:

•	Table Pool. Displays the table names in the current subject area that are not selected for schema generation.

•	Table. Displays the name of the table that is currently selected.

•	Table Filter. Displays the table names in the current subject area that are selected for schema generation. By default, all tables are listed in the Table Filter list box.

•	. Moves the selected table name in the Table Pool list box to the Table Filter list box.

•	. Moves the selected table name in the Table Filter list box to the Table Pool list box

•	. Moves all tables in the Table Pool to the Table Filter list box.

•	. Moves all tables in the Table Filter to the Table Pool list box.

•	Close. Closes the dialog and saves any changes you have made.

The purpose of each control in the Display Names group box is explained below:

•	Physical. Click this button to display physical table names in the Table Pool and Table Filter list boxes.

•	Logical. Click this button to display entity names in the Table Pool and Table Filter list boxes.

Note:	If you select one or more tables in your data model and open the <Database> Schema Generation Report Editor, when you click the Filter button, ERwin asks if you want to use the tables that are currently selected as your model filter. Click Yes if you want to generate your data model using only the selected tables or click No to open the Table Filter dialog and select from all the tables in the current subject area.

In order to properly maintain database integrity when comparing an open model with a SQL script or ER1/ERX model, you must verify that all dependent tables are included in the Differences list. See Filtering Dangling Relationships  for more information.

Related Topics

  To filter tables in the Set Options dialogs

  To filter tables in the Schema Generation Report Editor


To filter tables in the Set Options dialogs

1.	Click Update Model, Alter Database, or Complete Compare on the Tasks menu. ERwin displays the Set Options dialog.

2.	Click Filter. ERwin displays the Report Filter Editor.

3.	Choose one or more of the following options:

•	Select a table name in the Table Filter list box and click [image] to move the table name to the Table Pool list box.

•	Select a table name in the Table Pool list box and click [image] to move the table name to the Table Filter list box.

•	Click [image]. ERwin moves all of the table names to the Table Pool list box.

•	Click [image]. ERwin moves all of the table names to the Table Filter list box.

4.	Click Close.

Note:	ERwin uses the list of table names in the Table Filter list box when it compares the model to the database, DDL script file, ERwin data model, or ModelMart diagram during synchronization. ERwin also changes the Table Filter text to show the number of tables selected out of the total number of tables in the current subject area (e.g., 7/19).


To filter tables in the Schema Generation Report Editor

1.	Click Forward Engineer/Schema Generation on the Tasks menu. ERwin displays the Schema Generation Report Editor.

2.	Click Filter. ERwin displays the Report Filter Editor.

3.	Choose one or more of the following options:

•	Select an table name in the Table Filter list box and click [image] to move the table name to the Table Pool list box.

•	Select an table name in the Table Pool list box and click [image] to move the table name to the Table Filter list box.

•	Click [image]. ERwin moves all of the table names to the Table Pool list box.

•	Click [image]. ERwin moves all of the table names to the Table Filter list box.

4.	Click Close.

Note:	ERwin changes the Table Filter text to show the number of tables selected out of the total number of tables in the current subject area (e.g., 7/19).


Inferring Primary Key and Relationship Information

When you reverse engineer a database or DDL script file, ERwin automatically creates both a logical and physical representation of each item in the database, even for databases that do not support logical constructs. For example, ERwin automatically generates names for entities and attributes that correspond to the table and column physical names even if the target database does not provide logical name information.

ERwin also provides two additional options that can speed the creation of the logical data model: inferring primary keys and inferring relationship information. If your target database does not support the definition of primary keys or relationships, or if the database was constructed without them, you can choose to have ERwin generate primary keys and relationships for the data model automatically. You may also want ERwin to infer primary keys and relationships if you are reverse engineering using an ODBC driver that does not provide primary key and relationship information.

The Infer group box on the Reverse Engineering - Set Options dialog or Import Changes dialog lets you control whether or not ERwin infers the primary key, foreign key, and relationship information.

When inferring primary keys or relationships from indexes, ERwin examines the indexes of each table. The criteria ERwin uses to infer primary keys, foreign keys, and relationships is listed in the table below.

Database Item	Inference Rule
Primary Key	If a table includes one index that is defined as “unique” or "primary" for that table.
Relationship	Infer from Indexes: If a table includes an index that includes the same index members in the same order as an index identified as a primary key in a different table, and also includes additional columns not found in the primary key. Infer from Names: If a table includes an index that has the same name as an index identified as a primary key in a different table.
Parent/Child	After inferring a relationship, ERwin determines that the larger index (more columns) belongs to the child table and the smaller index (fewer columns) belongs to the parent.
Foreign Key	After inferring a relationship, ERwin determines that the index members in the child table that match those in the primary key of the parent table comprise the foreign key.
Identifying or Non-Identifying	After inferring a relationship, ERwin determines that a non-identifying relationship exists if the index columns do not appear in the primary key in the child table and an identifying relationship exists if the index columns do appear in the primary key in the child table.

If you ask ERwin to infer primary keys or relationships for a database that already has some of these logical items defined, ERwin attempts to infer additional information. For example, if the schema contains some primary key information, ERwin attempts to infer primary keys for tables where this information is not explicitly defined in the database schema.

Note:	In general, the criteria that ERwin uses for inferring primary key and relationship information leads to correct inferences. However, there is no guarantee that these inferences are always correct.


Case Conversion of Logical and Physical Names

ERwin supports case conversion of physical and logical names when you reverse engineer, or import changes into a model using the Update Model or Complete Compare options. These options let you easily set and conform to formatting standards for physical and logical names, both in your model and in the database schema.

ERwin performs the case conversion of physical names before it attempts to match the items in the model with equivalent items in the database, DDL script file, ERwin data model, or ModelMart diagram. Although ERwin converts the physical names before starting synchronization, it does not actually apply the changes until the physical names are imported into your model.

During import, ERwin converts the case of logical names as information is read from the database, DDL script file, ERwin data model, or ModelMart diagram.

Conversion options for both logical and physical names are explained below:

When you choose…	ERwin…	Examples
None	Preserves the case of logical or physical names exactly as they appear in the target database, SQL DDL script, ERwin data model or ModelMart diagram.	MOVIE_COPY  Movie_copy movie_copy	MOVIE_COPY Movie_copy movie_copy
lower	Changes logical or physical names to lowercase during import.	Movie_copy	movie_copy
UPPER	Changes logical or physical names to uppercase during import.	Movie_copy	MOVIE_COPY
Mixed	Changes logical or physical names to initial capitals during import.	MOVIE_COPY  movie_copy	Movie_Copy Movie_Copy


Expanding and Collapsing the Differences List

ERwin organizes the differences list in the Resolve Differences dialogs using a hierarchical list structure. An item type such as Triggers, for example, is followed by an indented list of all trigger items that are in the source model and target database, DDL script, ERwin data model, or ModelMart diagram. The hierarchical relationship between items in the Differences list is shown by the gray lines connecting the items.

The purpose of each control in the hierarchical list structure is explained below:

•	. Click this button to hide all properties for the selected object.

•	. Click this button to show all properties for the selected object.

Related Topics

  To expand or collapse the differences list


To expand or collapse the differences list

1.	Choose one of the following options:

•	To expand an item in the Differences list in the Resolve Differences dialogs, click [image].

•	To collapse the list for an item in the Differences list, click [image].

Note:	You can also expand and collapse the Differences list by examining the item properties or double-clicking on the item name. See Examining and Changing Item Properties  for more information.


Summary of DB Item Icons in the Differences List

ERwin displays an icon for each item listed in the Resolve Differences dialogs.

DB Icon	Item Type	Item Type Example
	ERwin model	MOVIES.ER1
	DBMS	SYBASE
	SQL Script	C:\ERWIN\TEST.SQL
	All tables	Tables
	Table	CUSTOMER
	All columns	Columns
	Column	CUSTOMER_NAME
	Defaults Validations User Defined Datatypes (UDDs) Stored Procedure Trigger	sp_default CHECK_AVAIL_STOCK CALC_METHOD SP_O123_X TL_MOVIE_COPY
	Foreign Key Reference or Relationship	Contact.Customer_Number
	All views	Views
	View	CUSTOMER_RECEIPT


Using the Resolve Differences Toolbar Buttons

The toolbar buttons in the Resolve Differences dialog let you change the action for the selected item(s), match or unmatch items in the differences list for the selected item.

The Import, Export, Ignore, and Delete tools let you change the action for an item in the Differences list. For example, if you click on the line containing your ERwin model name (at the top of the Differences list) and click the Export button, ERwin changes the action for all items on the list to Export.

You can also change the action assigned to an individual item (e.g., the customer_address column) or item property (e.g., the name property for the customer_address column) in the same way. For example, to import a table in a database that is not in your ERwin data model, click on the table in the Differences list and click the Import tool. ERwin changes the action for the table to Import.

The Match and UnMatch tools let you change ERwin’s default item matches. ERwin does not automatically match a table in your ERwin data model named CUSTOMER with the CUST table in the database. ERwin detects that the names are different, and places the items on two different line in the Differences list. You can manually match the CUSTOMER and CUST table in the Differences list so that ERwin compares the table properties. Similarly, if ERwin matches two objects that should not be compared, you can use the UnMatch tool to break the match.

ERwin saves manual matching information in the data model when you save the model. The next time you compare the model, ERwin checks to see if an item was manually matched with a different item the last time it was compared. If it was manually matched, ERwin automatically matches the data model item with the correct item in the Differences list.

Related Topics

  To import, export, ignore, or delete items in the Resolve Differences dialog

  To match items in the Resolve Differences dialog

  To unmatch items in the Resolve Differences dialog


To import, export, ignore, or delete items in the Resolve Differences dialog

1.	In the Resolve Differences dialog, select the item(s) you want to import, export, ignore, or delete:

•	To select one item and all its properties, click on the item in the Differences list.

•	To select multiple items, hold down the Shift or Control key and click on the items.

2.	Choose one of the following actions:

•	Click [image] if you want to include the selected item or property in your model.

•	Click [image] if you want to include the selected item or property in the target database.

•	Click [image] if you want ERwin to ignore the item or property during import and export.

•	Click [image] if you want ERwin to delete the item or property during import or export. ERwin activates the Delete button only if the item is not matched with any other item in the Differences list.

ERwin changes the action for the selected item(s). When you reverse engineer, import changes, or export changes, ERwin updates the model and/or database based on the action you select in the Resolve Differences dialog.

Note:	The toolbar buttons are available or unavailable (dimmed) depending on whether or not the action is available for the selected item.


To match items in the Resolve Differences dialog

1.	In the Resolve Differences dialog, click  [image] . ERwin changes the cursor to a double-ended arrow [image].

2.	Click on one of the items you want to match (e.g., the customer_zip column).

3.	Click on the second item in the match (e.g., the customer_zip_code column). ERwin displays a confirmation message.

4.	Click Yes. ERwin moves the items to the same line in the Differences list.

Note:	The toolbar buttons are available or unavailable (dimmed) depending on whether or not the action is available for the item selected. For example, if you select the CUSTOMER table in the model list and it matches the CUSTOMER table in the database, the Match button is unavailable.


To unmatch items in the Resolve Differences dialog

1.	In the Resolve Differences dialog, click on the line that contains the items you want to unmatch (e.g., the customer_name columns).

2.	Click [image]. ERwin moves the items to the different lines in the Differences list.

Note:	The toolbar buttons are available or unavailable (dimmed) depending on whether or not the action is available for the item selected.


Resolve Differences Action Bar

Action Bar	Indicates that you want ERwin to...
	(Export)	Forward engineer the item in your model (on the left side of the window) to the database or SQL script file.
	(Import)	Reverse engineer an item or property in the target database, DDL script, ModelMart diagram, or ER1/ERX file (in the right side of the window) to update your model.
	(Import/ Export)	Forward engineer one or more properties AND reverse engineer one or more properties in this item.
	(Delete during Export)	Delete the item or property in the database (on the right side of the window) during export.
	(Delete during Import)	Delete the item or property in your model (on the left side of the window) during import.
	(Ignore)	Ignore the item or property during forward and reverse engineering.
	(Ignore All)	Ignore the item and all its properties during forward and reverse engineering.


Examining and Changing Item Properties

The Item Property shortcut menu lets you change the action for the selected item or item property, view details, or expand or collapse the Differences list. When you right-click on an item in a Resolve Differences dialog, ERwin displays the Item Property shortcut menu.

The purpose of each control in the Item Property shortcut menu is explained below:

•	Export. Click this option to set the action to Export [image] for this item property.

•	Import. Click this option to set the action to Import [image] for this item property.

•	Ignore. Click this option to set the action to Ignore [image] or [image] for this item property

•	Delete. Click this option to set the action to Delete [image] or [image] for this item. This option is only available if the item is not currently synchronized (matched) with another item in the Differences list.

•	UnMatch. Click this option to unmatch this item and any subordinate items on the left side of the Differences list with items on the right side. ERwin moves the unmatched items to different lines in the Differences list. This option is only available if the item is matched with another item in the Differences list.

•	Expand Fully. Click this option to expand the differences list and show all items or item properties that are subordinate to the selected item regardless of whether they are the same or different. This option is dimmed (unavailable) if all subordinate items are currently displayed.

•	Expand Differences. Click this option to expand the differences list to show all subordinate items or item properties that are different in the source and target. This option is dimmed (unavailable) if all differences are currently displayed.

•	Collapse Fully. Click this option to collapse the differences list to hide all items or item properties that are subordinate to the selected item. This option is dimmed (unavailable) if all differences are currently hidden.

•	Show Details. Click this option to open the Details of Selected Item dialog. This dialog lets you view the details for items and item properties, and explains the action that you have selected for that item.


Generating a Comparison Report

When you use the Resolve Differences dialog in the Complete Compare, Update Model, or Alter Database processes, you can create a report that shows the actions selected for the items and properties in the change list. You can choose to include only the items shown in the current view of the change list or include all the items in the item pool, even if they are hidden in the current view.

When you click the Report button at the bottom of the Resolve Differences dialog, ERwin displays the Comparison Report Options dialog.

The purpose of each control in the Include Items Marked group box is described below:

•	Export. Click this button to include items and properties in the report that are marked for export in the change list.

•	Import. Click this button to include items and properties in the report that are marked for import in the change list.

•	Ignore. Click this button to include items in the report that you want ERwin to ignore during the synchronization. If you choose this option in the Resolve Differences dialog, your data model and database will not be in sync after you finish importing and/or exporting the changes.

•	In-Sync. Click this button to include items and properties in the report that are already in sync in both your data model and the database.

The purpose of each control in the Text Line Options group box is described below:

•	Truncate. Click this button to truncate each line if the number of characters exceeds the space allowed in a column (40 characters).

•	Wrap Around. Click this button to wrap text to the next line if the number of characters exceeds the space allowed in a column (40 characters).

The purpose of each control in the Report Content group box is described below:

•	Current View. Click this button to include only the items and properties in the report that appear in the current view of the change list, and exclude items and properties that are hidden when the change list is collapsed.

•	Expanded View. Click this button to include all items and properties in the report, even if they are hidden in the current view of the change list.

All other controls in this dialog are described below:

•	Preview. Click this button to open the Report Preview window.

•	Print. Prints the report on the default printer.

•	Save. Saves the report to disk. ERwin displays the Save As dialog to let you name the report.

•	Close. Closes the Comparison Report Options dialog and return to the Resolve Differences dialog.

Related Topics

  To generate a comparison report


To generate a comparison report

1.	Click the Report button in the Resolve Differences dialog

2.	Select one or more options that you want to include in the report from the Include Items Marked group box.

3.	In the Text Line Options group box, select the option that you want to apply to lines that exceed the number of characters allowed for the column (40 characters).

•	Choose Truncate to truncate the characters at the end of a text line in the column.

•	Choose Wrap Around to wrap the text to the next line in the column.

4.	In the Report Content group box, select the option that you want to apply to the report.

•	Choose Current View to include in the report only the items that appear in the current view of the Differences list, but exclude items that are hidden because the Differences list is collapsed for a particular item.

•	Choose Expanded View to include all items in the report, even if they are hidden in the current view of the Differences list.

5.	Choose one of the following options to generate the report:

•	Click [image].

•	Click Preview to view the report on screen, then click [image].

•	Click [image]. ERwin opens the Save As dialog. You can name the report and save it to disk.


Filtering Dangling Relationships

When you forward engineer or update a database, ERwin lets you use a subset of the tables in your model. For example, you can generate the schema from a user-defined subject area, which can contain a subset of the tables in the Main Subject Area. You can also use the Report Filter Editor to choose a subset of tables to include when synchronizing or creating a database.

When you are working with a subset of the tables in the model, special care must be taken to account for dangling relationships, which are relationships to tables that are not included in the schema generation or database update. ERwin offers the following options to ensure that dangling relationships do not impact data integrity:

•	Filtering dangling relationships in the Subject Area Editor for schema generation.

•	Automatic discovery of dangling relationships when synchronizing a model with a database.

Related Topics

  Filtering Dangling Relationships when Generating a Schema

  To filter dangling relationships from the schema

  Managing Dangling Relationships During Synchronization


Filtering Dangling Relationships when Generating a Schema

When you create a subject area, you include a subset of tables and other objects from the Main Subject Area in a separate diagram so that you can work with a smaller group of tables. See Using the Subject Area Editor  for more information.

By default, when ERwin generates the schema for a subject area, it references tables in the Main Subject Area that are not in the new subject area, specifically in statements related to foreign keys and triggers. Optionally, ERwin lets you exclude references to these objects in the schema statements.

For example, in the MOVIES diagram , ERwin migrates the primary key customer-number from the CUSTOMER table into the MOVIE-RENTAL-RECORD table as a foreign key (which is assigned the rolename renting-customer). If you create a subject area that includes MOVIE-RENTAL-RECORD but does not include CUSTOMER, ERwin still identifies renting-customer as a foreign key in the schema.

If you select the Filter Dangling Relationship from Schema Gen box in the Subject Area Editor, ERwin eliminates the foreign key reference to the extraneous CUSTOMER table.

Note:	When you select the Filter Dangling Relationship from Schema Gen option, ERwin still shows attributes that migrate from tables outside of the subject area as foreign keys (i.e., this option has no effect on the graphical objects in the diagram, only the schema statements change).

When you open the Subject Area Editor from the Main Subject Area, ERwin disables the Filter Dangling Relationship from Schema Gen option since all tables are included in the Main Subject Area.


To filter dangling relationships from the schema

1.	Click [image] to open the Subject Area Editor.

2.	Select the Filter Dangling Relationships from Schema Gen check box.

3.	Click OK. ERwin returns to the Diagram window.

4.	When you are ready to generate the schema, click Forward Engineer/Schema Generation on the Tasks menu.

5.	Click Generate in the Schema Generation Report Editor to generate the schema. ERwin references only the objects in the current subject area when it generates the schema statements that relate to foreign keys and triggers.

Note:	You can preview, print, or save the schema as a report file, or forward engineer the schema to the database using the standard controls in the Schema Generation Editor. See Forward Engineering/Generating a Database Schema  for more information.


Managing Dangling Relationships During Synchronization

When you update a parent table in your database, ERwin may choose to implement the change by dropping and recreating the table. When ERwin drops and recreates a table, it must also drop and recreate all dependent foreign keys in all child tables to maintain database integrity.

ERwin automatically tracks and recreates all foreign key dependencies for a dropped table if:

•	You are comparing your model with an existing database. ERwin queries the database to locate any child tables and can then issue a statement to recreate the foreign key dependency.

OR

•	All affected child tables are also included in the Resolve Differences list.

ERwin can only drop and recreate the foreign key dependencies if it can find them in the database or the Resolve Differences list. If you are comparing your model to a SQL script file or ERwin model AND a child table with a dependent foreign key is not included in the compare, ERwin cannot find and maintain the foreign key dependencies.

In order to properly maintain database integrity, if you are comparing your model with a SQL script or ER1/ERX model, you should verify that all dependent tables are included in the Differences list.

Note:	If you modify a table that is referenced by stored procedures, triggers, and views, the referencing items may be invalidated or dropped (for DB2/MVS and some other DBMSs) depending on the type of modification. ERwin does not recompile or recreate these items automatically.


Using the DB Sync Button

When you click the DB Sync button in various ERwin editors, ERwin starts the Complete Compare task.

When using DB Sync, ERwin only compares the properties in the Editor that launched it. For example, if you click DB Sync in the Column Editor, ERwin automatically filters the items to compare in the Options Set list to show only column properties. All other features of the Complete Compare task are exactly the same as when the task is started from the Tasks menu.

Related Topics

  Setting Options for Complete Compare


Toolbar Buttons in Preview Dialogs
Using Toolbar Buttons

ERwin provides toolbar buttons for common operations such as, save, print, find, cut, copy, and paste in preview dialogs that contain edit controls, such as, the <Database> Schema Generation Report Preview dialog.

The purpose of each toolbar button is explained below:

•	 (Save). Click this button to save the text displayed in the dialog text box to a ASCII text file with the TXT extension.

•	 (Print). Click this button to print the text displayed in the dialog text box to the Windows default printer.

•	 (Find). Click this button to open the Find dialog. In the Find dialog, type a text string in the Find What text box and click Find Next to search the dialog text box for occurrences of the text string. Check the Match Case box if you want the search to be case sensitive (e.g., “CREATE” does not find “Create”). See Using the Find Dialog for more information.

•	 (Find and Replace). Click this button to open the Replace dialog. Type a text string in the Find What and Replace With text boxes, then click Find Next to search the dialog text box for occurrences of the text string and replace it with the specified replacement string. Check the Match Case box if you want the search to be case sensitive (e.g., “CREATE” does not find “Create”).

•	 Cuts, copies, and pastes text using the Windows clipboard.


Using the Find Dialog

The Find dialog lets you find text strings in preview dialogs, such as, the <Database> Schema Generation Report Preview dialog. When you click the Find button [image] , ERwin open the Find dialog.

Each control in the Find dialog is explained below:

•	Find What. Type the text string that you want to locate (e.g., CREATE TABLE).

•	Find Next. Click this button to search the Preview dialog text window for occurrences of the text string.

•	Match Case. Check this box if you want the search to be case sensitive (e.g., CREATE does not find Create).


Forward and Reverse Engineering Physical Storage Objects

If you generate a physical schema on a database server, you can include the physical storage objects you’ve defined in ERwin as part of the schema. ERwin automatically translates the physical object definitions into the appropriate SQL CREATE statements and inserts the specified parameter information in the correct syntax.

When you generate the physical schema, ERwin creates the specified parent storage objects first, and then it creates child storage objects and physical tables in the specified storage location. The Schema Options group on the Schema Generation Report Editor contains the options for forward engineering physical storage objects.

In addition, when you reverse engineer a database, ERwin can import the names and definitions of physical storage objects defined on the target server in the same way it imports physical tables, indexes, and other physical schema information.

After you import physical storage objects into ERwin, you can view or modify the object definitions and table associations in the Physical Object Editor and the Table Property Editor in the same way you work with physical storage objects originally created in ERwin.

The following table shows the physical storage objects that ERwin can forward and reverse engineer.

Server	Forward Engineering	Reverse Engineering
DB2/MVS	Stogroup, Database, Tablespace	Stogroup, Database, Tablespace
DB2/2	Tablespace	Tablespace
INFORMIX	—	blobspace, dbspace
ORACLE	Database, Tablespace, Rollback Segment	Database, Tablespace, Rollback Segment
Red Brick	Segment	Segment
SQL Server	—	Segment
SQL Anywhere      and WATCOM	DBSPACE	DBSPACE
SYBASE	—	Segment
Teradata	Database	Database
Related Topics

  Using the Physical Object Editor

  Associating ERwin Tables with Physical Storage Objects

  Using the Schema Generation Editor


Forward and Reverse Engineering Indexes

If you generate a physical schema, you can include any indexes you’ve defined in ERwin as part of the schema. ERwin automatically translates the index definitions into schema statements and inserts the specified parameter information in the correct syntax.

The Index Option group box in the Schema Generation Editor lets you select which indexes ERwin includes when it generates a schema. The Schema Generation Editor includes all index options supported by the target server.

ERwin generates schema statements for primary key, alternate key, foreign key, inversion entry key, and clustered indexes.

ERwin also generates schema statements for physical storage objects if the option is supported by the server and selected in the Schema Generation Report Editor.

When you reverse engineer a database, ERwin can import the name, definition and parameters of each index defined on the server. When you import the index information from a server, ERwin maintains the storage location information for each index, so later, you can recreate the database using the same storage assignments. You do not have to manually reassign the storage location for each index.

After you import indexes into ERwin, you can view or modify the index properties, definitions and table associations in the Index Editor. For DB2/MVS, INFORMIX, ORACLE, SQL Server, and SYBASE, you can assign an index to a physical storage object in the <Database> Index Editor. For DB2/MVS, INFORMIX, and ORACLE, you can also modify the storage parameters in the <Database> Index Editor.

Note:	If the target server is DB2/MVS, INFORMIX, ORACLE, or SYBASE and any Physical Storage option is selected, the schema includes index physical storage parameters in the schema statement.

Related Topics

  Using the Index Editor

  Using the Schema Generation Editor


Forward and Reverse Engineering Validation Rules

When you generate a physical schema, you can include any table-level or column-level validation rules you have defined in ERwin as part of the schema. ERwin automatically translates the validation rule  definitions into schema statements and inserts the specified parameter information in the correct syntax.

To include column-level validation rules, click the Validation check box (or the equivalent option for your server) in the Column Option group box in the <Database> Schema Generation Editor. Similarly, to include table-level validation rules, click the Table CHECK box (or the equivalent option for your server) in the Table Option group box.

The following table lists the options on the <Database> Schema Generation Report dialog for each target server that let you include table and column-level validation rules in the schema.

SQL Target Server	Column-Level Validation	Table-Level Validation
AS/400	N/A	N/A
DB2/MVS 2.0 and 3.0	FIELDPROC	VALIDPROC
DB2/MVS 4.0	FIELDPROC/Check	VALIDPROC/Check
DB2/2	Column CHECK	Table CHECK
INFORMIX	Column CHECK	Table CHECK
INGRES	Integrity	Integrity
InterBase	Column CHECK	Table CHECK
OpenIngres	Integrity/Check	Integrity/Check
ORACLE	CHECK Constr	Table CHECK
PROGRESS [4GL]	Validation	Table Validation
PROGRESS [ODBC SQL]	N/A	N/A
Rdb	Column CHECK	Table CHECK
Red Brick	N/A	N/A
SQL Anywhere/WATCOM	Column CHECK	Table CHECK
SQL Server 4.2	sp_bindrule	N/A
SQL Server 6.0	Validation	Table CHECK
SQLBase	N/A	N/A
SYBASE 4.2	sp_bindrule	N/A
SYBASE 10 and 11	Validation	Table CHECK
Teradata	BETWEEN	N/A
Access [Access Basic]	Column Validation	Table Validation
Access [ODBC SQL]	N/A	N/A
Clipper	N/A	N/A
dBASE III/IV	N/A	N/A
FoxPro	N/A	N/A
Paradox	N/A	N/A
Note:	ERwin cannot generate a validation rule statement in the schema if the target database does not support the required validation syntax (indicated by N/A in the above table). Consult your DBMS documentation for additional information on support and syntax for data validation rules.

When reverse engineering from a schema file, script, or system catalog, ERwin automatically imports validation rules and attaches them to the appropriate table or column in the resulting data model. The naming convention that ERwin uses to name rules as they are imported is: VALID_RULEn, where n is a sequential number starting at zero (i.e., the first validation rule that ERwin encounters when reverse engineering is named VALID_RULE0, the next rule VALID_RULE1, etc., until the entire schema has been processed).

Related Topics

  Using the Validation Rule Editor

  Using the Valid Value Editor

  Using the Schema Generation Editor


Working with Tables

In the Table Editor, you can specify table properties including table names, comments, volumetrics, user-defined table properties, synonyms, aliases, table storage locations, validation rules, stored procedures, and scripts. When you select DM (Dimensional Modeling) notation for your physical model, you can also specify dimensional information for a table.

An ERwin physical model can contain independent tables and dependent tables. An independent table is a table whose instances can be uniquely identified without determining its relationship to another table. A dependent table is a table whose instances cannot be uniquely identified without determining its relationship to another table or tables. Dependent tables are child tables that include all or a portion of the primary key of the parent table in their primary key, and that rely on the migrated foreign key columns for identity.

ERwin draws the table box with a horizontal line which divides the box in half. You can enter the primary keys in the top half of the table box and non-keys in the bottom half of the table box. You can choose to have keys migrate to either the primary or non-key area of the box. See Creating a Relationship in the Physical Model for more information.

When you add a table to the diagram, ERwin labels the table E_n, where E stands for table, and n is a unique number.

Related Topics

  Creating a Table

  Using the Table Editor

  Table Synonyms

  Table Alias Names


Creating a Table

There are several ways that you can directly or indirectly add one or more tables to a physical model, including:

•	Adding tables to a physical model using the Table tool. See Using the Table Tool for more information.

•	Adding entities to a logical model. See Working With Entities for more information.

•	Creating many-to-many relationships in the logical model. When you create a many-to-many relationship in the logical model, ERwin automatically resolves the relationship in the physical model. The result is an associative table with an identifying relationship to each of the two tables involved in the many-to-many relationship. See Resolving Many-To-Many Relationships in the Physical Model for more information.

•	Reverse engineering an existing database. See Reverse Engineering from a DDL Script or Database


Using the Table Tool

ERwin includes a single tool in the ERwin toolbox for creating both dependent and independent tables, as shown below.

The type of table, independent or dependent, is determined by the type of relationships in which the table is involved. When you first place a table in the ERwin diagram, it is represented as an independent table. When you connect it to another table using a relationship tool in the ERwin toolbox, ERwin determines if the table is independent or dependent based on the relationship type. If a table is a child table in an identifying relationship, it appears as a dependent table (box with rounded corners) in your diagram. All other tables appear as independent tables (box with square corners).

By default, each table you add to the physical model automatically appears in the logical model as an entity. If you want a table to appear in the physical model only, you can choose the Physical Only option in the Table Editor. See Using the Table Editor for more information.

Related Topics

   To create a table in the physical model


To create a table in the physical model

1.	Click [image].

2.	Click anywhere on the diagram. ERwin draws the new table and labels it E_n, where E stands for table, and n is a unique number. The default table name is highlighted in an edit window on the diagram.

3.	Type a name for the table in the open edit window.

4.	Press SHIFT+ENTER to close the edit window for the table name.

5.	Optionally, you can add one or more columns to the table at this time. More>

Note:	The [image] tool creates both dependent and independent tables. When you create an identifying relationship between two independent tables, the child table automatically becomes a dependent table.


Using the Table Editor

Using the Table Editor, you can view and update the properties for each table in the physical schema, and access editors to create validation rules and physical storage. Properties that can be assigned to a physical table include the table name, alias or synonym, physical storage device, validation rules, volumetrics, scripts, and stored procedures.

When you select DM (Dimensional Modeling) notation, ERwin identifies the physical model as Dimensional in the option list and includes additional editing options.

When you choose Table on the Edit menu or Table Editor on the Table shortcut menu, ERwin displays the <target server> Table Editor.

The purpose of each control in the Table Editor is explained below:

•	Table. Displays the name of the selected table. To view the properties of a different table, select a different table name from the list.

•	Name. Edit the name of the current table.

•	Owner. Type an owner name for a table, if you want the owner name to be different from the name of the user generating the schema.

•	Physical Only. Select this check box if you want this table to appear in the physical model only. Clear this check box if you also want this table to appear in the logical model as an entity.

•	Generate. Select this check box if you want the CREATE TABLE statement for this table to appear in the schema generation script.

•	DB Sync. Click this button to start the Complete Compare task, so you can synchronize the tables defined in your data model with the information stored on the server. See Using the DB Sync Button for more information. This button is only available if you have selected the Stored Procedure tab.

•	PB Sync. Click this button to synchronized table extended attributes in ERwin with the PowerBuilder Dictionary. This button is only available if you have selected the PowerBuilder tab. See Selecting a Target Client for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Often, ERwin displays only the first few tabs that are available. You can scroll through the available tabs using the spin control [image] to locate the tab you want.

The Table Editor includes the following tabs:

•	Dimensional. Specify dimensional modeling table roles, slowly changing dimension types, and data warehouse rules for the selected table. This tab is available when you use DM (Dimensional Modeling) notation for your physical model.

•	Comment. Type a comment for the selected table.

•	Volumetrics. Type table sizing information including growth estimates.

•	Physical Props. Associate tables to predefined physical storage devices.

•	Partitions. Specify physical partition values. This tab is only available when you have Oracle 8.x as your target server.

•	UDP. Specify values for user-defined table properties.

•	Validation. Attach validation rules to tables in your model.

•	Synonym. Specify synonym names for each table in your model. This tab is only available if your target server supports synonyms.

•	Alias & Synonym. Specify table alias and synonym names for each table in your model. This tab is only available if your target server is DB2/MVS.

•	Alias. Specify table alias for each table in your model. This tab is only available if your target server is DB2/2.

•	Stored Procedure. Manage the stored procedures that are attached to the tables in your model.

•	Pre & Post Script. Manage the scripts that are attached to the tables in your model.

•	PowerBuilder. Specify PowerBuilder extended attributes for each table in your model. This tab is only available if your target client is PowerBuilder.

Related Topics

  To change a table name in the Table Editor

  To specify a table owner

  To specify table properties

  To display a table in the physical model only


To change a table name in the Table Editor

1.	Choose Table on the Edit menu.

2.	Select the table that you want to change from the Table list.

3.	Edit the name for the table in the Name text box.

4.	Click OK.

Tip:	You can also edit a table name using on-diagram editing. In your diagram, click on the table name you want to change, wait a moment, then click again. You can now edit the table name directly on the diagram.


To specify a table owner

1.	Choose Table on the Edit menu.

2.	Select the table that you want to change from the Table list.

3.	Type an owner name in the Owner text box, if you want the name to be different from the name of the user generating the schema.

4.	Click OK.

Tip:	To display owner names on the diagram, right-click on the diagram background then select the Table Owner option on the shortcut menu.


To specify table properties

1.	Choose Table on the Edit menu.

2.	Select the table for which you want to specify properties from the Table list.

3.	Choose one or more of the following options:

•	To specify dimensional information for the table, click the Dimensional tab.

•	To add or modify a comment for the table, click the Comment tab.

•	To add table size and growth estimates, click the Volumetrics tab.

•	To associate or disassociate tables to predefined physical storage devices, click the Physical Props tab.

•	To add or modify user-defined table property values, click the UDP tab.

•	To attach or detach a validation rule, click the Validation tab.

•	To add or modify a table synonym, click the Synonym or Synonym & Alias tab.

•	To add or modify a table alias, click the Alias or Synonym & Alias tab.

•	To attach or detach a stored procedure, click the Stored Procedure tab.

•	To attach or detach a script, click the Pre & Post Script tab.

•	To add or modify PowerBuilder attributes, click the PowerBuilder tab.

4.	Click OK.

Note:	If you need help after you switch to a different tab, press F1 for information about the specific table property.


To display a table in the physical model only

1.	Choose Table on the Edit menu.

2.	Select the table from the Table list that you want to appear only in the physical model.

3.	Select the Physical Only check box.

4.	Click OK.


Specifying Dimensional Modeling Table Options

The Dimensional tab of the Table Editor is only available when you select DM (Dimensional Modeling) notation for your physical model. You can use the controls in the Dimensional tab to view and update dimensional modeling roles, slowly changing dimension types, and data warehouse maintenance rules.

The purpose of each control in the Dimensional tab is explained below.

•	Dimensional Modeling Role. These options assign the table’s role in the dimensional model.

•	Calculate Automatically (based on usage). Select this check box to have ERwin automatically assign a dimensional modeling role to the selected table based on the relationship(s) drawn to other tables. Clear this check box to make the Fact, Dimension, and Outrigger buttons available and manually assign a dimensional modeling role to the selected table regardless of relationships drawn to other tables.

•	Fact. Click this button to manually assign a Fact role to the selected table. This button is available when you clear the Calculate Automatically check box.

•	Dimension. Click this button to manually assign a Dimension role to the selected table. This button is available when you clear the Calculate Automatically check box.

•	Outrigger. Click this button to manually assign an Outrigger role to the selected table. This button is available when you clear the Calculate Automatically check box.

•	Dimension Type. These options document how to update information in the data warehouse if the table has a Dimension role.

•	Slowly Changing. Select this check box to assign a dimension type to the selected table. This check box is available when the table’s dimensional modeling role is Dimension.

•	Dimension Type (List).Select a dimension type for the selected table from the list. This list is available when you select the Slowly Changing check box.

•	Data Warehouse Rules. These options document data warehouse maintenance rules for the table.

•	Refresh. Select a Refresh data warehouse rule to assign to the selected table.

•	 (Refresh). Click this button to open the Data Warehouse Rule Editor and add a Refresh rule. The Refresh type filter is automatically selected.

•	Append. Select a Refresh data warehouse rule to assign to the selected table.

•	 (Append). Click this button to open the Data Warehouse Rule Editor and add an Append rule. The Append type filter is automatically selected.

•	Backup. Select a Backup data warehouse rule to assign to the selected table.

•	 (Backup). Click this button to open the Data Warehouse Rule Editor and add a Backup rule. The Backup type filter is automatically selected.

•	Recovery. Select a Recovery data warehouse rule to assign to the selected table.

•	 (Recovery). Click this button to open the Data Warehouse Rule Editor and add a Recovery rule. The Recovery type filter is automatically selected.

•	Archiving. Select a Archiving data warehouse rule to assign to the selected table.

•	 (Archiving). Click this button to open the Data Warehouse Rule Editor and add an Archiving rule. The Archiving type filter is automatically selected.

•	Purge. Select a Purge data warehouse rule to assign to the selected table.

•	 (Purge). Click this button to open the Data Warehouse Rule Editor and add a Purge rule. The Purge type filter is automatically selected.

Related Topics:

  Using the Table Editor

  To assign a dimensional modeling role

  Accounting for Slowly Changing Dimensions

  To assign a dimension type to a dimension table

  To attach a data warehouse rule in the Table Editor

  To select dimensional modeling notation


To assign a dimensional modeling role

1.	Right-click on the table you want to change, choose Table Editor on the shortcut menu, then choose Dimensional on the submenu.

2.	Choose one of the following:

•	To have ERwin automatically assign a dimensional modeling role to the table, select the Calculate Automatically (based on usage) check box.

•	To manually assign a dimensional modeling role to the table, clear the Calculate Automatically (based on usage) check box and click the Fact, Dimension, or Outrigger button to assign the role.

3.	Click OK.


Accounting for Slowly Changing Dimensions

In dimensional modeling theory, dimension tables contain static data (unchanging). But in the reality information does change over time; customer names and addresses change, company products evolve, and markets realign. Dimensions that change over time are referred to as slowly changing dimensions. In the data warehouse environment, accuracy of historical data can be as important as accuracy of current data.

Dimensional modelers suggest three ways of updating dimension information. Each choice provides a varying degree of information. In the Dimensional tab of the Table Editor, you can flag each dimension or outrigger table as Fixed (unchanging) or slowly changing Types 1, 2, or 3.

•	Type 1 - Flag to overwrite the old data in the record with the new data. With Type 1, you lose the ability to track the old data for the record.

•	Type 2 - Flag to create an additional dimension record with the new data at the time of the change. With Type 2, you can accurately track history based on the old and new descriptions, but it requires a generalized key to reference all iterations of the original record.

•	Type 3 - Flag to create new fields in the record for the new data and the time of the change. With Type 3, you can only track original and current values; intermediate values are lost.

You can set the dimension type for any dimension table, regardless if it is automatically or manually assigned. You cannot choose dimension type options if the dimensional modeling role is fact. The default dimension type is Fixed, unchanging.

Related Topics:

  To assign a dimension type to a dimension table

  Specifying Dimensional Modeling Table Options

  Dimension Table

  Creating a Slowly Changing Dimension Report


To assign a dimension type to a dimension table

1.	Right-click on the table you want to change, choose Table Editor on the shortcut menu, then choose Dimensional on the submenu.

2.	If the dimensional modeling role of the table is Dimension or Outrigger, choose one of the following:

•	To flag the table as a Fixed dimension, clear the Slowly Changing check box.

•	To flag the table as a Type 1 dimension, select the Slowly Changing check box and select Type 1 from the Dimension Type list.

•	To flag the table as a Type 2 dimension, select the Slowly Changing check box and select Type 2 from the Dimension Type list.

•	To flag the table as a Type 3 dimension, select the Slowly Changing check box and select Type 3 from the Dimension Type list.

3.	Click OK.


To attach a data warehouse rule in the Table Editor

1.	Right-click on the table you want to change, choose Table Editor on the shortcut menu, then choose Dimensional on the submenu.

2.	Select a data warehouse rule from the corresponding list for each rule type you want to attach: Refresh, Append, Backup, Recovery, Archiving, Purge.

3.	Click OK.


Specifying a Table Comment

You can use the controls in the Comment tab of the Table Editor to view and update the table comment. You can generate the table comment if this feature is supported by your target server.

The purpose of each control in the Comment tab is explained below:

•	Comment. Type or edit the comment for the selected table. If your target server supports comments, ERwin optionally generates comments in the schema DDL script.

•	Update Entity Definition to Match. Select this check box if you want to keep the table comment and the corresponding entity definition in sync. Clear this check box if you want this table comment and the corresponding entity definition to contain different text.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Note:	If you add a definition for the corresponding entity in the logical model, the Comment tab displays the entity definition as the table comment.

Related Topics

  Using the Table Editor

  To specify a table comment


To specify a table comment

1.	Right-click on the table you want to change, choose Table Editor on the shortcut menu, then choose Comment on the submenu.

2.	Type a comment in the Comment text box.

3.	If you want the corresponding entity definition to match the table comment, select the Update Entity Definition to Match check box.

4.	Click OK.

Tip:	You can also edit a table comment using on-diagram editing if comments are displayed on your diagram. See Comment Display Level for more information. In your diagram, click on the table comment you want to change, wait a moment, then click again. You can now edit the table comment directly on the diagram.


Specifying Volumetrics Information

You can specify table size and growth values in the Volumetrics tab of the Table Editor. Then you can view and report table and database size calculations in the Volumetrics Editor. See Using the Volumetrics Editor for more information.

The purpose of each control in the Volumetrics tab is explained below:

•	Sizing Information. Type the estimated row counts for the Initial, Max, and Grow By text boxes as accurately as possible. These entries have the greatest effect on the calculated table size.

•	Initial. Type an initial number of records for the selected table.

•	Max. If applicable, type the maximum allowable number of records that the table is designed to hold. You can leave this option blank to achieve open ended growth. You must use this option with Grow By (see below) to determine when a table will reach its designed record limit.

•	Grow By. If applicable, type the estimated number of records that you expect the table to grow per month. This option is useful for generating reports on future table and database growth. If you have a maximum record number in the Max text box, table growth will stop at that record number.

Related Topics

  Using the Table Editor

  To specify volumetric information in the Table Editor

  Calculating Table and Database Size

  Using the Column Editor


To specify volumetric information in the Table Editor

1.	Right-click on the table you want to change, choose Table Editor on the shortcut menu, then choose Volumetrics on the submenu.

2.	Type the initial number of table rows in the Initial Rows text box.

3.	To specify a table row limit, type the maximum number of rows in the Max Rows text box.

4.	To specify a table growth rate, type the estimated number of rows per month in the Grow By text box.

5.	Click OK.


Specifying Table UDP Values

After you create UDPs for a table in the UDP Editor, you can easily specify property values for the table in the UDP tab of the Table Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP from which you can select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Table Editor

  To specify table UDP values

  Creating User-Defined Properties


To specify table UDP values

1.	Create a table user-defined property (UDP). More>>

2.	Choose Table from the Edit menu.

3.	Click on the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Attaching a Validation Rule to a Table

You can attach a validation rule to a table, rather than a specific column, if the rule involves multiple columns. For example, in the Movies model, you can attach a rule to the MOVIE_RENTAL_RECORD table to specify that the value entered in the rental_date column must be less than (come before) the value entered in the due_date column. To enforce this constraint, you might create a validation rule called Check-Date that creates the server expression: rental_date <= due_date. Using this rule, the server returns an error message if you try to enter a due date that comes before the rental date. See Specifying Constraints for more information on validation rules.

You can use the Validation tab of the Table Editor to assign validation rules to tables in your model. From the Validation tab, you can also open the Validation Rule Editor to create new rules.

The purpose of each control on the Validation tab is explained below:

•	Attached Validation. Lists the validation rules that are attached to the current table. Select a validation rule from the list and click Detach to remove a validation rule from the current table.

•	<- Attach. Attaches the selected validation rule to the current Table.  This button is unavailable if you have not selected a validation rule in the Unattached Validation list box.

•	Detach ->. Detaches the selected validation rule from the current table. This button is unavailable if you have not selected a validation rule in the Attached Validation list box.

•	Unattached Validation. Lists the validation rules that are available in your model. Select a validation rule from the list and click Attach to attach the validation rule to the current table.

•	Validation Rule. Displays the SQL syntax for the selected validation rule.

•	Column Name. Lists the columns in the selected table for reference purposes only.

•	Validation… Click this button to open the Validation Rule Editor. See Using the Validation Rule Editor for more information.

Related Topics

  Using the Table Editor

  To attach a validation rule to a table

  To detach a validation rule from a table


To attach a validation rule to a table

1.	Right-click on the table you want to change, choose Table Editor on the shortcut menu, and then click the Validation tab.

2.	Click the name of the validation rule you want to attach to the table in the Unattached Validation list box.

3.	Click Attach.

4.	Click OK.


To detach a validation rule from a table

1.	Right-click on the table you want to change, choose Table Editor on the shortcut menu, and then click the Validation tab.

2.	Click the name of the validation rule you want to detach from the table in the Attached Validation list box.

3.	Click Detach.

4.	Click OK.


Table Synonyms

When you refer to a table, you can use a synonym, a unique name for a table, rather than the table’s physical name. ERwin supports the definition of synonyms for all versions of the DB2/MVS, INFORMIX, ORACLE, Red Brick, and SQLBase target databases. Synonyms are similar to table alias names which ERwin also supports. See Table Alias Names,for more information.

ERwin also supports the creation of relationships based on synonyms for the Red Brick target server. See Understanding Red Brick Synonym Relationships for more information.

Related Topics

  Using the Table Editor

  DB2/MVS Table Synonyms

  INFORMIX Table Synonyms

  ORACLE Table Synonyms

  SQL Base Table Synonyms

  Red Brick Table Synonyms

  To create a synonym

  Creating a Synonym-Based Relationship in Red Brick


DB2/MVS Table Synonyms

When you select DB2/MVS as the target server for an ERwin data model, ERwin provides support for table synonyms and other DB2/MVS database constructs. Synonym support is implemented on the Alias & Synonym tab in the Table Editor. See DB2/MVS Table Alias Names  for more information about DB2/MVS alias names.

Each control in the Alias & Synonym tab that applies to DB2/MVS synonyms is explained below:

•	Alias & Synonym. Displays the synonym and alias names that are assigned to the current table.

•	SYNONYM. Select this check box if you want the selected name in the Alias & Synonym list box to be a synonym for the current table. Clear the check box if you want the selected name to be an alias.

•	New. Click this button to open the New Synonym dialog and add a synonym for the selected table.

•	Rename. Click this button to open the Rename Synonym dialog and edit the name of the selected synonym.

•	Delete. Deletes the selected synonym.

•	Database. Applicable for Alias names only.

•	Comment. Applicable for Alias names only.

Related Topics

  Using the Table Editor

  Table Synonyms

  To create a synonym


INFORMIX Table Synonyms

When you select INFORMIX as the target server for an ERwin data model, ERwin provides support for table synonyms and other INFORMIX database constructs. Synonym support is implemented in the Synonym tab of the Table Editor.

Each control in the Synonym tab for INFORMIX target servers is explained below:

•	SYNONYM. Displays the synonym names that are assigned to the current table.

•	New. Click this button to open the New Synonym dialog and add a synonym for the selected table.

•	Rename. Click this button to open the Rename Synonym dialog and edit the name of the selected synonym.

•	Delete. Deletes the selected synonym.

Each control in the Synonym Properties group box is explained below:

•	Type. Select this check box if you want to specify whether the synonym is explicitly created as a public or private database object.

•	PUBLIC. Select this check box if you want the synonym name to be available to all database users.

•	PRIVATE. Select this check box if you want the synonym name to be available to the current user name only.

•	DATABASE. Type the database name in which you want the synonym to be available.

Related Topics

  Using the Table Editor

  Table Synonyms

  To create a synonym


ORACLE Table Synonyms

When you select ORACLE as the target server for an ERwin data model, ERwin provides support for table synonyms and other ORACLE database constructs. Synonym support is implemented in the Synonym tab of the Table Editor.

Each control in the Synonym tab for ORACLE target servers is explained below:

•	SYNONYM. Displays the synonym names that are assigned to the current table.

•	New. Click this button to open the New SYNONYM dialog and add a synonym for the selected table.

•	Rename. Click this button to open the Rename SYNONYM dialog and edit the name of the selected synonym.

•	Delete. Deletes the selected synonym.

Each control in the Synonym Properties group box is explained below:

•	PUBLIC. Select this check box if you want the synonym name to be available to all database users. Clear this check box if you want the synonym name to be available to the current user name only.

•	DBLINK. Type the database name in which you want the synonym to be available.

Related Topics

  Using the Table Editor

  Table Synonyms

  To create a synonym


SQL Base Table Synonyms

When you select SQLBase as the target server for an ERwin data model, ERwin provides support for table synonyms and other SQLBase database constructs. Synonym support is implemented in the Synonym tab of the Table Editor.

Each control in the Synonym tab for SQLBase target servers is explained below:

•	SYNONYM. Displays the synonyms that are assigned to the current table.

•	New. Click this button to open the New SYNONYM dialog and add a synonym for the selected table.

•	Rename. Click this button to open the Rename SYNONYM dialog and edit the name of the selected synonym.

•	Delete. Deletes the selected synonym.

•	PUBLIC. Select this check box if you want the synonym name to be available to all database users. Clear this check box if you want the synonym to be available for the current user name only.

Related Topics

  Using the Table Editor

  Table Synonyms

  To create a synonym


Understanding Red Brick Synonym Relationships

In Red Brick, a synonym is a unique name for a parent table that can be used to develop multiple relationships between the parent and child. When a table has two distinct relationships with another table, a synonym can be used to implement one of the relationships and enable the same foreign key to appear twice in the child table. For example, if you want to alter the Movies model to show that customers can return a rented tape at any store, not just the store from which it was rented, you can include a STORE table and two relationships between STORE and MOVIE_RENTAL_RECORD. One relationship, <rented from>, references the ID number of the store that rented the tape to the customer. The second relationship, <returned to>, references the ID number of the store to which the tape was returned. The information in both columns migrates from the STORE table to MOVIE_RENTAL_RECORD through the creation of foreign keys.

To support this new business rule, the video store data modeler adds a synonym, RETURNSTORE, to the STORE table in the Table Editor and adds the <returned to> relationship to the data model using the synonym name as the parent table name. A rolename return_store_id is also specified for the migrated foreign key store_number. As a result, MOVIE_RENTAL_RECORD table includes two separate foreign key columns from the parent table: the original renting_store_id primary key attribute migrated to the table through the <rented from> relationship, and the new return_store_id migrated to the table through the <returned to> relationship.

You can preview the Schema Generation Report for the model to see DDL script changes. Click here to see sample DDL statements that implement these relationships for the MOVIE_RENTAL_RECORD table.

Related Topics

  Red Brick Table Synonyms

  To create a synonym

  Creating a Synonym-Based Relationship in Red Brick


Sample SQL Code for Red Brick Synonym Relationship


Red Brick Table Synonyms

When you select Red Brick as the target server for an ERwin data model, ERwin provides support for table synonyms and other Red Brick database constructs. Synonym support is implemented in the Synonym tab of the Table Editor.

Each control in the Synonym tab for Red Brick target servers is explained below:

•	SYNONYM. Displays the synonyms that are assigned to the current table.

•	New. Click this button to open the New SYNONYM dialog and add a synonym for the selected table.

•	Rename. Click this button to open the Rename SYNONYM dialog and edit the name of the selected synonym.

•	Delete. Deletes the selected synonym.

•	COMMENT. Type a description or comment for the current synonym name.

Related Topics

  Using the Table Editor

  Table Synonyms

  To create a synonym

  Creating a Synonym-Based Relationship in Red Brick


To create a synonym

1.	Choose Table on the Edit menu.

2.	Select a table name in the Table list box.

3.	Choose one of the following options:

•	To create a synonym for a DB2/MVS target server, click the Alias & Synonym tab.

•	To create a synonym for an INFORMIX, ORACLE, Red Brick, or SQLBase target server, click the Synonym tab.

4.	Click New.

5.	Type the synonym name in the Name text box, then click OK.

6.	If your target server is DB2/MVS, select the SYNONYM check box.

7.	Set any other properties appropriate to your target server.

8.	Click OK.


Creating a Synonym-Based Relationship in Red Brick

To create a synonym-based relationship in Red Brick, you must complete the following steps:

1.	Define a synonym in the Table Editor. Create a synonym for the parent table name in the parent-child relationship. Red Brick Table Synonyms

2.	Create a relationship that references the synonym table name. Create a parent-child relationship in your model.

3.	Add a rolename for the migrated foreign key. Switch to the logical model and define a rolename in the Relationship Editor for the foreign key attribute migrated through the synonym relationship. See Defining Attribute Rolenames and Referential Integrity Trigger Actions for more information.

4.	Select the table synonym as the new parent table for the relationship using the Parent Table Name list box in the Relationship Editor. Using the Relationship Editor in the Physical Model

Related Topics

  To create a synonym-based relationship in Red Brick


To create a synonym-based relationship in Red Brick

1.	Right-click on the parent table, point to Table Editor, then click Synonym on the Table Editor submenu.

2.	Click New.

3.	Type the synonym name in the Name text box, then click OK.

4.	Click OK to close the Table Editor.

5.	Draw a relationship line between the parent table (selected in Step 2) and the child table that you want to participate in the synonym relationship.

6.	Select the Logical Model option from the Logical/Physical Model list box in the ERwin toolbar to switch to the logical model.

7.	Right-click on the new relationship, then click Relationship Editor on the shortcut menu.

8.	Click the Rolename/RI Actions tab.

9.	Select the migrated attribute in the Migrated Attribute list box.

10.	Type a rolename for the attribute in the Rolename text box.

11.	Click OK to close the Relationship Editor.

12.	Select the Physical Model option from the Logical/Physical Model list box in the ERwin toolbar to return to the physical model.

13.	Right-click on the new relationship, then click Relationship Editor on the shortcut menu.

14.	Click the RI Actions tab.

15.	Select the synonym name (entered in Step 3) for the parent table in the Parent Table Name list box.

16.	Click OK.


Table Alias Names

An alias is an indirect way to reference a table in SQL statements so that if the table name changes, only the alias definition has to change. ERwin lets you specify an alias name for a table for the DB2/MVS and DB2/2 target servers using the Table Editor.

Related Topics

  Using the Table Editor

  DB2/MVS Table Alias Names

  DB2/2 Table Alias Names

  To create a table alias name


DB2/MVS Table Alias Names

An alias is an indirect way to reference a table in SQL statements so that if the table name changes, only the alias definition has to change. When you select DB2/MVS as the target server for an ERwin data model, ERwin provides support for table alias names, synonyms, and other DB2/MVS database constructs. Alias support is implemented on the Alias & Synonym tab in the Table Editor.

Each control on the Alias & Synonym tab for DB2/MVS target servers is explained below:

•	Alias & Synonym. Displays the alias and synonym names that are assigned to the current table.

•	SYNONYM. Clear this check box if you want the name entered in the Name text box to be an alias name for the current table.

•	New. Click this button to open the New Alias dialog and add an alias for the selected table.

•	Rename. Click this button to open the Rename Alias dialog and edit the name of the selected alias.

•	Delete. Deletes the selected alias.

•	Database. Type the database name in which you want the alias name to be available. This control is enabled if you clear the SYNONYM check box.

•	Comment. Type a description or comment for the current alias name. This control is enabled if you clear the SYNONYM check box.

Related Topics

  Using the Table Editor

  Table Alias Names

  To create a table alias name


DB2/2 Table Alias Names

An alias is an indirect way to reference a table in SQL statements so that if the table name changes, only the alias definition has to change. When you select DB2/2 as the target server for an ERwin data model, ERwin provides support for table alias names and other DB2/2 database constructs. Alias support is implemented on the Alias tab in the Table Editor.

The purpose of each control in the Alias tab is explained below:

•	Alias. Displays the alias names that are assigned to the current table.

•	New. Click this button to open the New Alias dialog and add an alias for the selected table.

•	Rename. Click this button to open the Rename Alias dialog and edit the name of the selected alias.

•	Delete. Deletes the selected alias.

•	Comment. Type a description or comment for the current alias name.

Related Topics

  Using the Table Editor

  Table Alias Names

  To create a table alias name


To create a table alias name

1.	Choose Table on the Edit menu.

2.	Select a table name in the Table list box.

3.	Choose one of the following options:

•	To create an alias for a DB2/MVS target server, click the Alias & Synonym tab.

•	To create an alias for a DB2/2 target server, click the Alias tab.

4.	Click New.

5.	Type the alias name in the Name text box, then click OK.

6.	Clear the Synonym check box (DB2/MVS only).

7.	Optionally, you can type a comment in the Comment text box or provide the name of the database in which the alias is valid in the Database text box.

8.	Click OK.

Note:	Alias names for tables are only supported for DB2/MVS and DB2/2 target servers.


Working with Triggers

A trigger is a named set of precompiled SQL statements stored on the server that is automatically executed when a specified event occurs. For example, a trigger can be executed whenever a row in an existing data table is inserted, updated, or deleted. The trigger tells the DBMS how to process the SQL INSERT, UPDATE, or DELETE commands to enforce the organization’s normal business rules.

A referential integrity trigger is a special kind of trigger that is used to maintain integrity between two related tables. For example, if a row in a parent table is inserted, updated, or deleted, a referential integrity trigger (hereafter called an RI trigger) tells the DBMS what to do to rows in other tables that have a foreign key value that matches the primary key in the row being added, updated, or deleted.

ERwin provides a set of 24 default RI triggers in template form that you can attach to tables to tell the target server how to enforce referential integrity. For special situations, you can use the ERwin macro language to customize these RI trigger templates in order to override the default code that is generated by ERwin. Click the Macro button at the top of this help window for more information on the ERwin template macros.

Related Topics

  Using Referential Integrity to Enforce Business Rules

  Using ERwin Default Triggers

  Overriding ERwin Trigger Templates

  Creating an RI Type Override Template

  Creating a Relationship Override Trigger Template

  Using the Table Trigger Editor

  Using the Template Toolbox and Macros

  Schema Generation Options for Triggers


Using Referential Integrity to Enforce Business Rules

Business rules are logical constructs that express how a business uses its data. ERwin lets you use a set of built-in referential integrity options to capture common business rules that apply to relationships between data that is kept in different tables.  You can enforce these rules using a variety of different programming techniques, including:

•	Application logic, such as front-end applications or stored procedures.

•	Declarative referential integrity, declaring which RI rule is to be enforced for each table relationship in the schema.

•	Triggers, which are segments of SQL code that are executed automatically by the database when a SQL INSERT, UPDATE, or DELETE command is executed against a table.

One of the best ways to enforce RI rules is through the use of triggers. Unlike the coding in front-end applications, triggers are centrally located, so that if the business rule changes, the change can be implemented once. Triggers also support the enforcement of additional rules, beyond those supported by declarative referential integrity. For example, in an Order Entry database, if you want to flag backorder items when creating a row in the CUST_ORDER table, you could create a custom trigger to check a quantity_on_hand value for a product when inserting a row into the ORDER_LINE table.

ERwin triggers can effectively handle the most common rules for enforcing referential integrity without any additional programming or customization. For example, the question, “Can I delete an order that has one or more order line details?” is a question that is answered by a business rule and can be enforced by a built-in ERwin trigger. If the business answer to this question is:

•	“No, if there is a line item, the order cannot be deleted, then you can enforce this behavior by attaching the Parent Delete-RESTRICT trigger to the relationship between CUST_ORDER and ORDER_LINE. Once the trigger is generated, whenever a user attempts to delete a row in the CUST_ORDER table, the delete fails if there are one or more rows in the child ORDER_LINE table.

•	“Yes, if there is a line item, the order can be deleted and the line item must also be deleted, then you can enforce this behavior by attaching the Parent Delete-CASCADE  trigger to the relationship between CUST_ORDER and ORDER_LINE so that whenever the user deletes a row in the CUST_ORDER table, the dependent rows in the child ORDER_LINE table are also deleted.

In a similar way, the business rule might dictate that the dependent rows in the child ORDER_LINE table should not be deleted when the row in the CUST_ORDER table is deleted, but that the foreign key value should be set to NULL or to a default value. Each of these options can also be handled automatically using ERwin-generated triggers.

Related Topics

  Using ERwin Default Triggers

  Overriding ERwin Trigger Templates


Using ERwin Default Triggers

To create a trigger, you normally have to manually enter the required SQL code on the server. To save you time, ERwin provides a set of default RI trigger templates that generate this SQL code automatically.

For target databases that support triggers, ERwin includes 24 different triggers that correctly implement referential integrity according to the relationship in your model and the options you have selected, including:

•	Table’s role in the relationship: PARENT or CHILD

•	SQL command type: INSERT, UPDATE, or DELETE

•	Referential integrity action: CASCADE, RESTRICT, SET NULL, SET DEFAULT

In addition, you can choose NONE as the trigger type if you do not want to generate a trigger for the selected triggering action.

Each template contains text, SQL code, and macros that can be generically applied to any table or relationship in your model. The macros in the template act as placeholders.  During schema generation, ERwin expands the macros into physical table, column, and relationship names: each macro derives its value based on the context of the relationship to which the template is attached. By attaching a template to a table that is either the PARENT or CHILD table in a relationship, you define the context for macro expansion.

For example, if you attach the PARENT DELETE RESTRICT RI trigger template to the relationship:

MOVIE is in stock as MOVIE COPY

When you generate the trigger, ERwin expands the macros in the trigger template. As a result, each time ERwin finds the macro %Parent it substitutes the name of the parent table, which is MOVIE, when it finds %VerbPhrase, it substitutes the phrase “is in stock as” , and when it finds %CHILD it substitutes the name of the child table in the relationship, which is MOVIE_COPY.  Because ERwin uses macros in place of specific table names and relationships, the default RI trigger templates generate the correct CREATE TRIGGER SQL statements for all the tables in the database.

Related Topics

  To generate default triggers for an ERwin model

  Setting ERwin Trigger Defaults


Setting ERwin Trigger Defaults

ERwin applies default referential integrity (RI) rules and triggers to each relationship in the physical model. You can specify which default trigger ERwin applies to a relationship in two ways:

•	For all relationships in your model. You can set the default RI action and trigger you want to associate with each type of relationship when you choose a target server. See Using the Referential Integrity Default Editor for more information.

•	For an individual relationship. You can choose a different RI action and trigger for an individual relationship in your diagram. To override a default RI action for a table in a specific relationship, open the Relationship Editor and choose a different RI action. See Defining Referential Integrity Trigger Actions for more information.

Using these settings, you can specify exactly which of ERwin’s set of standard RI triggers you want to generate for each table and each relationship in your diagram.

If the default triggers do not fully implement all of the business rules that you want to apply to a specific table, relationship, or RI action (such as Parent-Delete CASCADE), you can customize the SQL code in an ERwin trigger by customizing the default RI trigger or by creating a table override trigger. See the Overriding ERwin Trigger Templates for information on modifying default trigger behavior.


To generate default triggers for an ERwin model

1.	Set the default referential integrity options for your model using the Target Server dialog. More>

2.	Optionally, override the default settings for individual relationships using the Relationship RI Editor. More>

3.	Select Forward Engineer on the Tasks menu.

4.	Select the ERwin Generated check box.

5.	Choose one or more of the following options:

•	Click the Generate button to generate the triggers directly to the target database.

•	Click the Preview button, then click [image] to save the triggers in a DDL script file.


Using Trigger Controls in the Target Server Dialog

The Target Server dialog contains three controls that let you define referential integrity and trigger defaults for your model.

The purpose of each trigger control in the Target Server dialog is explained below:

•	RI Defaults. Click this button to open the Referential Integrity Default Editor. The RI Default Editor lets you set the default referential integrity action (CASCADE, RESTRICT, etc.) for each SQL action (CHILD DELETE, CHILD UPDATE, etc.) for ERwin relationships. See Using the Referential Integrity Default Editor for more information.

•	Trigger Directory. (PROGRESS only) Click this button to open the Default Trigger Directories/Prefixes dialog. This dialog lets you specify a directory for ERwin-generated triggers. See Specifying Default Trigger Directories for PROGRESS for more information.

•	Trigger Delimiter. (DB2/2 and Interbase only) Lets you specify a delimiter character for DB2/2 and Interbase triggers. See Trigger Delimiter Option for more information.

Related Topics

  Choosing a Target Database and Setting ERwin Defaults


Using the Referential Integrity Default Editor

When you click the RI Defaults button in the Target Server dialog, ERwin displays the Referential Integrity Default Editor.

Controls on the Referential Integrity Default Editor are arranged in a matrix, so that you can specify a default RI setting in a drop-down list box for each potential SQL action and relationship type in your model.

The purpose of each column in the matrix is explained below:

•	Action. Lists the SQL action for which you can specify a default RI setting.

•	Identifying. Lists the default RI setting for the specified action for all identifying relationships in your model. To find the triggering action for each default RI setting, follow the row left to the Action column and read the corresponding action. Available RI settings are: CASCADE, RESTRICT, and NONE.

•	Non-Identifying, Nulls Allowed. Available RI settings are: CASCADE, RESTRICT, SET NULL, SET DEFAULT, and NONE.

•	Non-Identifying, No Nulls. Available RI settings are: CASCADE, RESTRICT, SET DEFAULT, and NONE.

•	Subtype. Available RI settings are: CASCADE, RESTRICT, and NONE.

•	Rebind. Rebinds referential integrity settings on all relationships in your model to the current settings in the RI Default Editor. If you are working with an existing model and change the default settings in this editor, you can click the Rebind button to implement the new defaults in the model for all existing relationships. If you save the new settings but do not rebind, the defaults affect new relationships only.

•	Reset. Resets the RI settings in the Editor to the system default.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	Database support of referential integrity varies. See your DBMS documentation for information on what referential integrity options it supports.

Related Topics

  Choosing a Target Database and Setting ERwin Defaults

  To change the default RI settings for all relationships


To change the default RI settings for all relationships

1.	Click Target Server on the Server menu.

2.	Click the RI Defaults button.

3.	Choose one or more of the following actions:

•	To change an RI action (CASCADE, RESTRICT, etc.) for one or more of the SQL actions and relationship types in the control matrix, select a new action from the drop-down list.

•	To return the settings to the system default, click Reset.

•	To apply the new default settings to any existing relationships in your model, click Rebind.

4.	Click OK to close the RI Default Editor.

5.	Click OK.


Trigger Delimiter Option

For DB2/2 and InterBase servers, ERwin lets you choose the character(s) you want to use to signify the end of a trigger or stored procedure statement in an ERwin-generated schema.

The purpose of the trigger delimiter control is as follows:

•	Trigger Delimiter. Type the character(s) you want to use as the delimiter for trigger and stored procedure statements in an ERwin-generated schema.

Related Topics

  Choosing a Target Database and Setting ERwin Defaults


Specifying Default Trigger Directories for PROGRESS

ERwin provides a utility for organizing ERwin-generated PROGRESS triggers. You can choose to save create, write, and delete triggers in separate directories and you can choose to use the dump file name, rather than the table name, as the trigger name. Click on the Default Trigger Directories button in the Target Server dialog to open the Progress Default Trigger Directories dialog.

The purpose of each control on the Default Trigger Directories/Prefixes dialog is explained below:

•	Create Triggers. Type the relative directory path to the directory in which you want to store the default create triggers that are automatically generated by ERwin.

•	Write Triggers. Type the relative directory path to the directory in which you want to store the default write triggers that are automatically generated by ERwin.

•	Delete Triggers. Type the relative directory path to the directory in which you want to store the default delete triggers that are automatically generated by ERwin.

•	Use Dump File Name As Trigger Name. Select this check box to use the dump file name if it exists, rather than the table name, as the trigger name. Clear the box if you want to use the table name in the trigger name.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	The relative directory path is the directory specification relative to the directory that contains the .DF file corresponding to your data model. The directory pointed to by the relative directory path must currently exist, otherwise ERwin displays an error message when attempting to generate the trigger code files.

Related Topics

  Choosing a Target Database and Setting ERwin Defaults


Overriding ERwin Trigger Templates

ERwin RI triggers are included in the product as trigger templates, which contain skeletal SQL code and ERwin macros. The macros take the place of physical table and column names, so that a single template can be applied to many different tables, and the correct table and column names are called by the code. ERwin expands the macros into code when you actually generate the trigger, or whenever you choose to preview the expanded code in a trigger editor.

Because there is a built-in template associated with each RI rule type, you can generate default trigger code for your entire model without any further work. If you use the ERwin default templates, ERwin composes the default trigger code using a fixed internal scheme for combining the different built-in templates.

If you want to change the trigger code generated by a built-in template, ERwin lets you customize the template and specify that the modified version should override the built-in template when the physical schema is generated. ERwin provides three ways to override the default trigger.

•	RI Type Override. For each of the referential integrity rule combinations, such as PARENT DELETE RESTRICT), ERwin lets you create a custom override template and use it instead of the default template for all the relationships in the diagram that have been assigned that RI rule type. Using the built-in template code as a starting point, this approach lets you make global RI changes by modifying the trigger code in only one place. RI Type Override templates are used instead of the original ERwin default templates if you choose the RI Type Override option when the schema is generated.

•	Relationship Override. If you want to override the default template for a particular relationship, you can modify the built-in template and attach the override version to just that relationship. For example, if the relationship between the MOVIE and MOVIE-COPY tables is set for Parent-Delete RESTRICT and you want to override the behavior for this relationship, you can create a Relationship Override trigger template for the Parent-Delete RESTRICT combination and attach the override template to the MOVIE--MOVIE-COPY relationship. Relationship Override templates are used instead of the original ERwin default templates (and RI Type Override template if one exists ) if you choose the Relationship Override option when the schema is generated.

•	Table Override. ERwin also lets you create custom Table Override triggers for any table in your diagram. Table Override templates are used instead of the built-in templates and any RI Type Override or Relationship Override templates you’ve created if you choose the Table Override option when the schema is generated.

The figure below shows how the ERwin trigger templates override one another. Each override level replaces the assigned templates on all lower levels.

Note:	You can also write triggers from scratch and save them in ERwin.

Related Topics

  Creating an RI Type Override Template

  Creating a Relationship Override Trigger Template

  Using the Table Trigger Editor


Creating an RI Type Override Template

An RI Type Override template is used to modify the behavior of the built-in template for an RI Trigger Type. For example, suppose whenever you delete a row in the parent CUST_ORDER table, you want ERwin to use the default Parent-Delete CASCADE trigger code to delete the associated child rows in the ORDER_LINE table. An added requirement, however, it that you automatically capture the deleted information and insert the deleted rows into a historical archive table any time Parent-Delete CASCADE is performed, so you can retrieve this information at a later date if necessary.

One way of doing this is to modify the built-in Parent-Delete CASCADE trigger to perform the archiving by creating an RI Type Override. There are several advantages to using an RI Type Override to modify default trigger behavior:

•	Only a couple lines of code need to be added to the trigger.

•	The modification is made in only one place.

•	It is propagated throughout the database, to all relationships with Parent-Delete CASCADE specified.

•	It never impacts the source code of any application.

•	If you decide to stop archiving this information, the original built-in template can be quickly reverted to the default Parent-Delete CASCADE trigger type.

Creating an RI Type Override template makes it easy to produce custom referential integrity triggers because all relationships that are assigned the overridden RI trigger type automatically use that template.

Note:	An RI Type Override modifies the behavior of all the attached triggers throughout the data model.

Related Topics

  Using the Trigger Template Editor


Using the Trigger Template Editor

The Trigger Template Editor lets you change the template that is attached to an RI trigger type and view or modify the macro code used by a particular template. When you change the template for a trigger, you can use another built-in template or a custom (user override) template.

The purpose of each control in the <Database> Trigger Template Editor is explained below:

•	Referential Integrity Type. Displays the name of the database action (for example, CHILD DELETE) and referential integrity action (CASCADE, RESTRICT, SET DEFAULT, and SET NULL) that causes the associated trigger to fire.

•	Attached Trigger Template. Displays the name of the trigger template that ERwin generates for the corresponding Referential Integrity Type.

•	Rebind. Attaches the default trigger templates to the associated referential integrity types.

•	Detach. Detaches the selected trigger template from the associated referential integrity type. ERwin does not generate a trigger for the selected referential integrity type if it does not have an associated trigger template.

•	Built-In Trigger Template. Lists the standard trigger templates that are built-in to ERwin. Select a template name and click the Attach button to attach it to the selected referential integrity type.

•	Attach. Attaches the selected built-in trigger template to the selected referential integrity type.

•	User Override. Lists the user-defined or -modified trigger templates available in your model. Select a template name and click the Attach button to attach it to the selected referential integrity type.

•	Attach. Attaches the selected user-defined or -modified trigger template to the selected referential integrity type.

•	Template Name. Displays the name of the selected template. Type a new name and click Add to create a new template.

•	Add. Creates a new user-defined trigger template and adds it to the User Override list.

•	Delete. Deletes the selected user-defined trigger template.

•	Trigger Toolbox. Click this button to open the Trigger Toolbox and select an ERwin macro to add to the trigger template.

•	Template Code. Displays the template code in the selected built-in or user-defined trigger template.

•	Close. Closes the dialog and saves your changes.

Related Topics

  To open the Trigger Template Editor

  To view the trigger template macro code

  To edit an RI type override trigger template

  To create an RI type override trigger template

  To change the template attached to an RI action

  To delete a custom template


To open the Trigger Template Editor

•	Select <Database> Trigger Template on the Server menu.

OR

•	Right-click on a table, click <Database> Trigger on the shortcut menu, then click <Database> Trigger Template.


To view the trigger template macro code

1.	Select <Database> Trigger Template on the Server menu.

2.	Select the trigger template you want to view in the Built-In Trigger Template or User Override list box.

3.	To see more code, choose one or more of the following actions:

•	To view additional lines of code, use the scroll bars to scroll the code in the Template Code window.

•	To increase the width or height of the window, drag the edge of the window horizontally or vertically

4.	Click Close.

Tip:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To edit an RI type override trigger template

1.	Select <Database> Trigger Template on the Server menu.

2.	Select the trigger template you want to edit in the User Override list box.

3.	Choose one or more of the following options:

•	To add text or code to the template, type the text in the window.

•	To add ERwin macro code, type the macro name and parameters in the window or click the Trigger Toolbox button to select a macro from the list provided.

•	To create a template or save the template under a new name, type a name in the Template Name text box then click Add.

4.	Click Close.

Tip:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To create an RI type override trigger template

1.	Select <Database> Trigger Template on the Server menu.

2.	Choose one of the following actions:

•	To create a new template from an existing one, select the template in the Built-in Trigger Template or User Override list box, type a name for the new template in the Template Name text box, then click Add.

•	To create a new, blank template, type a name for the new template in the Template Name text box, then click Add.

3.	Choose one or more of the following options:

•	To add text or code to the template, type the text in the Template Code window.

•	To add ERwin macro code, type the macro name and parameters in the window or click the Trigger Toolbox button to select a macro from the list provided.

4.	Select the RI action to which you want to attach the new template in the Referential Integrity Type list box.

5.	Click the Attach button above the User Override list box.

6.	Click Close.

Tip:	To generate an RI Type Override template in your schema, you must check the RI Type Override option in the Schema Generation Report Editor.

To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To change the template attached to an RI action

1.	Select <Database> Trigger Template on the Server menu.

2.	Select the RI action to which you want to attach a different trigger template in the Referential Integrity Type list box.

3.	Choose one of the following actions:

•	To detach a trigger template from the selected Referential Integrity Type, click Detach.

•	To reattach the system default trigger template to the selected Referential Integrity Type, click Rebind.

•	To attach a built-in template, select the trigger you want to attach in the Built-In Trigger Template list box, then click the Attach button directly above it.

•	To attach an RI type override template, select the trigger you want to attach in the User Override list box, then click the Attach button directly above it.

4.	Click Close.

Tip:	To generate an RI Type Override template in your schema, you must check the RI Type Override option in the Schema Generation Report Editor.


To delete a custom template

1.	Select <Database> Trigger Template on the Server menu.

2.	Select the RI type trigger override you want to delete in the User Override list box.

3.	Click Delete.

4.	Click Close.

Note:	You can delete custom templates, but you cannot delete the built-in templates that are shipped as part of ERwin.


Creating a Relationship Override Trigger Template

To make a database easier to maintain, we recommend you try to make your triggers function identically throughout the data model. However, sometimes you may need to modify the built-in trigger for just one relationship. A Relationship Override template is used to modify the behavior of the built in template for just one relationship rather than for all the relationships assigned to the associated RI trigger type.

For example, whenever you try to delete a row in the parent CUST_ORDER table, you may want ERwin to use the default Parent-Delete RESTRICT trigger code to check to see if there are any unfulfilled items in the order. If there are unfulfilled line items, you probably want to use the default trigger code that prevents you from deleting the order. However, suppose in this specific situation, you also want the referential integrity trigger to automatically change the value in the Order_Status column to “Outstanding.”

If you modify the built-in trigger to perform this action by creating an Relationship Override for the Parent-Delete RESTRICT trigger, this template is applied only to the relationship between the CUST_ORDER and ORDER_LINE tables. Although modifying how referential integrity is enforced for individual relationships can make database maintenance more difficult, using the Relationship Override option lets you support unique business rules for specific relationships.

Note:	A Relationship Override changes the way an RI trigger functions for one specific relationship.

Related Topics

  Using the Relationship Template Editor


Using the Relationship Template Editor

To open the Relationship Template Editor, right-click on a relationship line, then choose Relationship Template Editor on the shortcut menu.

The purpose of each control on the Relationship Template Editor is explained below:

•	Parent. Displays the name of the parent table in the selected relationship.

•	Verb Phrase. Displays the name of the selected relationship.

•	Child. Displays the name of the child table in the selected relationship.

•	Referential Integrity Type. Displays the name of the database action (for example, CHILD DELETE) and referential integrity action (CASCADE, RESTRICT, SET DEFAULT, and SET NULL) that causes the associated trigger to fire.

•	Trigger Template Override. Displays the name of the user override trigger template that that you want to generate for the corresponding Referential Integrity Type. If the option is blank (- - -), ERwin generates the template associated with the relationship type and RI action at the global level.

•	Detach. Detaches the trigger template override from the associated referential integrity type. ERwin generates the template associated with the relationship type and RI action at the global level if it does not have an associated override trigger template.

•	ERwin Trigger Template. Lists the standard trigger templates that are built-in to ERwin.

•	User Override. Lists the user-defined or -modified trigger templates available in your model. Select a template name and click the Attach button to attach it to the selected referential integrity type.

•	Attach. Attaches the selected user-defined or -modified trigger template to the selected referential integrity type.

•	Add. Creates a new user-defined trigger template and adds it to the User Override list.

•	Delete. Deletes the selected user-defined trigger template.

•	Template Name. Displays the name of the selected template. Type a new name and click Add to create a new template.

•	Template Code. Displays the template code in the selected built-in or user-defined trigger template.

•	Expanded Code. Displays the trigger code as it will appear in the physical schema.

•	Trigger Toolbox. Click this button to open the Trigger Toolbox and select an ERwin macro to add to the trigger template.

•	Close. Closes the dialog and saves your changes.

Related Topics

  To create a Relationship Override Trigger Template

  Relationship Override Trigger Example


To create a Relationship Override Trigger Template

1.	Right-click on the relationship line for which you want to create a custom trigger, then click Relationship Template Editor on the shortcut menu.

2.	Choose one of the following actions:

•	To create a new template from an existing one, select the template in the Built-in Trigger Template or User Override list box, type a name for the new template in the Template Name text box, then click Add.

•	To create a new, blank template, type a name for the new template in the Template Name text box, then click Add.

3.	Choose one or more of the following options:

•	To add text or code to the template, type the text in the Template Code window.

•	To add ERwin macro code, type the macro name and parameters in the window or click the Trigger Toolbox button to select a macro from the list provided.

4.	Select the RI action to which you want to attach the new template in the Referential Integrity Type list box.

5.	Click the Attach button above the User Override list box.

6.	Click Close.

Tip:	To generate a Relationship Override template in your schema, you must check the Relationship Override option in the Schema Generation Report Editor.

To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


Relationship Override Trigger Example

The template code below for the Relationship Override of the Parent-Delete RESTRICT trigger shows a portion of the template (top), the expanded code of the same portion (center), and the complete trigger template expanded for a SQL Server target (bottom). The template code for is for the relationship override on CUST_ORDER-ORDER_LINE relationship using the Parent-Delete RESTRICT trigger.

/* ERwin Built-in %Datetime */

    /* %Parent %VerbPhrase %Child ON PARENT DELETE RESTRICT */

    update %Parent

      set order_status = ‘outstanding’

      from %Parent,deleted,%Child

        where

          /* %%JoinPKPK(%Parent,deleted) */

          %JoinPKPK(%Parent,deleted) and

          /* %%JoinFKPK(%Child,deleted) */

          %JoinFKPK(%Child,deleted)

/* ERwin Built-in Mon Apr 05 07:52:30 1997 */

    /* CUST_ORDER contains ORDER_LINE ON PARENT DELETE RESTRICT */

    update CUST_ORDER

      set order_status = ‘outstanding’

      from CUST_ORDER,deleted,ORDER_LINE

        where

          /* %JoinPKPK(CUST_ORDER,deleted) */

          CUST_ORDER.order_id = deleted.order_id and

          /* %JoinFKPK(ORDER_LINE,deleted) */

          ORDER_LINE.order_id = deleted.order_id

create trigger tD_CUST_ORDER on CUST_ORDER for DELETE as

/* ERwin Builtin Mon Apr 05 07:49:49 1997 */

/* DELETE trigger on CUST_ORDER */

begin

  declare  @errno   int,

           @errmsg  varchar(255)

    /* ERwin Builtin Mon Apr 05 07:49:49 1997 */

    /* CUST_ORDER contains ORDER_LINE ON PARENT DELETE RESTRICT */

    update CUST_ORDER

      set order_status = ‘outstanding’

      from CUST_ORDER,deleted,ORDER_LINE

        where

          /* %JoinPKPK(CUST_ORDER,deleted) */

          CUST_ORDER.order_id = deleted.order_id and

          /* %JoinFKPK(ORDER_LINE,deleted) */

          ORDER_LINE.order_id = deleted.order_id

    /* ERwin Builtin Mon Apr 05 07:49:49 1997 */

    return

error:

    raiserror @errno @errmsg

    rollback transaction

end

go


Using the Table Trigger Editor

If you want to enforce specific business rules for individual tables, ERwin lets you modify the way a built-in trigger behaves for a particular table. An table override template is used to modify the behavior of the built-in template for just one table.

For example, suppose that each time an ordered line item is inserted into the ORDER_LINE table, you want ERwin to add the order_quantity amount from the ORDER_LINE table to the product_sold_quantity in the PRODUCT table. One way to do this is to create a Table Override trigger for the ORDER_LINE table that modifies the action performed by the built-in Child-Insert RESTRICT template.

To open the Table Trigger Editor, right-click on a table, choose <Database> Trigger on the shortcut menu, then click the <Database> Table Trigger button.

The purpose of each control on the Table Trigger Editor is explained below:

•	Table. Lists the name of the table for which you can create table override triggers. You can select a different table in the drop-down list.

•	Trigger. Displays the name of the table trigger templates that that you want to generate for the selected table. If the list is blank, ERwin generates the default RI triggers for each corresponding RI type.

•	New. Click this button to open the New Trigger dialog and add a new table trigger template.

•	Rename. Click this button to open the Rename Trigger dialog and edit the name of the selected table trigger template.

•	Delete. Deletes the selected table trigger template.

•	Trigger On. Select one or more options in the group box to specify for what actions you want the trigger to fire. When you select an option, ERwin automatically includes the built-in trigger template code for that action in the table trigger template.

•	Delete. Click this button if you want the selected table trigger template to fire when a SQL DELETE command is executed.

•	Insert. Click this button if you want the selected table trigger template to fire when a SQL INSERT command is executed.

•	Update. Click this button if you want the selected table trigger template to fire when a SQL UPDATE command is executed.

•	Fire. Available for AS/400 V3, DB2/2, INFORMIX, Interbase, ORACLE7, Rdb, SQLAnywhere V7, SQLBase V6, and Watcom V6 target servers. Select an option to specify when the trigger is fired. A macro for the specified option is included in the trigger template.

•	Before. Click this button if you want the trigger to fire before the SQL INSERT, UPDATE, or DELETE command is executed.

•	After. Click this button if you want the trigger to fire after the SQL INSERT, UPDATE, or DELETE command is executed.

•	Scope. Available for AS/400 V3, DB2/2, ORACLE7, SQLAnywhere V5, SQLBase V6, and Watcom V6 target servers. Select an option to specify how the trigger is fired. A macro for the specified option is included in the trigger template.

•	Table (ORACLE 7.x, SQLBase V6, Watcom V4, AS/400 V3). Click this button if you want the trigger to fire once each time a SQL INSERT, UPDATE, or DELETE command is executed against the table.  You can use the %Scope macro to include the FOR EACH TABLE clause in the trigger.

•	Stmt (DB2/2, SQL Anywhere V5). Click this button if you want the trigger to fire once each time a SQL INSERT, UPDATE, or DELETE command is executed.  You can use the %Scope macro to include the FOR EACH STATEMENT clause in the trigger.

•	Row. Click this button if you want the trigger to fire once each time a SQL INSERT, UPDATE, or DELETE command is executed against a row in the table.  You can use the %Scope macro to include the FOR EACH ROW clause in the trigger.

•	Old. Available for AS/400 V3, DB2/2, INFORMIX, Ingres, ORACLE7, Rdb, SQLAnywhere V5, SQLBase V6, and Watcom V6 target servers. Type the name you want to use to reference the pre-change data in the table. You can use the %RefClause macro (%ParamPass macro for Ingres) to include the REFERENCES clause in the trigger.

•	New. Available for AS/400 V3, DB2/2, INFORMIX, Ingres, ORACLE7, Rdb, SQLAnywhere V5, SQLBase V6, and Watcom V6 target servers. Type the name you want to use to reference the post-change data in the table. You can use the %RefClause macro (%ParamPass macro for Ingres) to include the REFERENCES clause in the trigger.

•	Parent. Displays the name of the selected table (if it is the parent table in a relationship) or the parent of the selected table, for each relationship in which the selected table is involved.

•	Verb Phrase. Displays the name of all relationships for the selected table.

•	Child.  Displays the name of the selected table (if it is the child table in a relationship) or the child of the selected table, for each relationship in which the selected table is involved.

•	Integrity Rule. List the referential integrity rules that apply to the selected relationship. Rules are abbreviated and indicate the RI trigger action, such as CHILD UPDATE (CU:) and the RI type, such as RESTRICT (R).

•	Template Code.  Displays the template code in the selected table trigger template.

•	Expanded Code [Read-Only]. Displays the trigger code as it will appear in the physical schema.

•	Toolbox. Click this button to open the Trigger Toolbox and select an ERwin macro to add to the trigger template.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	You can create separate table override triggers for insert, update and delete actions or you can combine different actions into a single trigger. If you want to combine actions, check each applicable Trigger On checkbox. For example, if you want to extend the customized table override trigger “special order-line insert” to calculate the product_sold_quantity on update and delete of ORDER_LINE as well as insert, check the update, delete and insert boxes and modify the template code to handle the conditions for recalculating product_sold_quantity under update and delete conditions.

If you create custom table triggers and attach them to specific tables, ERwin cannot use its standard scheme to combine the different built-in templates. You must assume responsibility for writing code that controls how the templates are combined for these tables. To assist you, ERwin provides a variety of special control macros, including macros that loop through all the relationships for a given table.

Related Topics

  Viewing the Default Trigger Code for a Table

  To create an table override trigger template

  Table Override Trigger Example


Viewing the Default Trigger Code for a Table

You can easily view the triggers that ERwin generates for a table in the Table Trigger Viewer. To open the Table Trigger Viewer, right-click on a table in your diagram, then click <Database> Trigger on the shortcut menu.

The purpose of each control in the Table Trigger Viewer is explained below:

•	Default Trigger Expansion [Read-Only]. Displays the expanded trigger code for each trigger associated with the selected table. To view the trigger code, scroll through the file or click [image] to view the code in a larger window.

•	<Database> Table Trigger. Click this button to open the Table Trigger Editor and create a table override trigger template for the selected table.

•	<Database> Trigger Template. Click this button to open the Trigger Template Editor and create an RI type override trigger template.

•	Close. Closes the dialog and saves your changes.

Related Topics

  To view or edit the default trigger code for a table

  To create a table override trigger template


To view or edit the default trigger code for a table

1.	Right-click on a table, then click <Database> Trigger on the shortcut menu.

2.	To see more code, choose one or more of the following actions:

•	To view additional lines of code, use the scroll bars to scroll the code in the Template Code window.

•	To increase the width or height of the window, drag the edge of the window horizontally or vertically.

3.	To edit the trigger code, choose one or more of the following actions:

•	To edit a trigger for the specified table, click the <Database> Table Trigger button.

•	To edit a trigger for a specified RI action, click the <Database> Trigger Template button.

4.	Click Close.


To create a table override trigger template

1.	Right-click on a table, then click <Database> Trigger on the shortcut menu.

2.	Click the <Database> Table Trigger button.

3.	Click New.

4.	Type a name for the trigger in the Name text box.

5.	Click OK.

6.	Select an option in the Trigger On group box to specify if you want the trigger to include built-in Insert, Update, or Delete trigger template code.

7.	Click in the Template Code window and modify the template code to suit your needs.

8.	Click OK.

Tip:	To generate a Table Override template in your schema, you must check the User Defined option in the Schema Generation Report Editor.


Table Override Trigger Example

The figure below shows the initial template code for creating an Table Override Child-Insert trigger on the ORDER_LINE table. The new code needed to add the order_quantity to the product_sold quantity is inserted immediately after the macro statement %ForEachChildRel( ) {%RelTemplate} because the ORDER_LINE table is the child in the relationship between ORDER_LINE and PRODUCT. The template with inserted code is shown directly following the default template. The final code listing shows the expanded code, as it appears for a SQL Server target.

create trigger %TriggerName on %TableName

  for %Actions(“,”)

  as

/* %Actions(“,”) trigger on %TableName */

/* default body for %TriggerName */

begin

  declare  @numrows int,

        @nullcnt int,

        @validcnt int,

        %PKDecl(,@ins),

        @errno   int,

        @errmsg  varchar(255)

  select @numrows = @@rowcount

%ForEachChildRel() {

  %RelTemplate

}

%ForEachParentRel() {

  %RelTemplate

}

  return

error:

     raiserror @errno @errmsg

     rollback transaction

end

go

The modified template code, which includes the custom code (shaded) required to modify the product_sold quantity in the PRODUCT table each time a new item row is added to the ORDER_LINE table, is shown below. To view the expanded code after the default template is modified, click in the Expanded Code window.

create trigger %TriggerName on %TableName

  for %Actions(“,”)

  as

/* %Actions(“,”) trigger on %TableName */

/* default body for %TriggerName */

begin

  declare  @numrows int,

        @nullcnt int,

        @validcnt int,

        %PKDecl(,@ins),

        @errno   int,

        @errmsg  varchar(255)

  select @numrows = @@rowcount

%ForEachChildRel() {

  %RelTemplate

  %If (%==(%VerbPhrase,is requested on)) {

    update %Parent from %Parent,inserted

      set product_sold_quantity = %Parent.product_sold_

quantity

           + inserted.order_quantity

      where

        %JoinFKPK(inserted,%Parent)

  }

}

%ForEachParentRel() {

  %RelTemplate

}

  return

error:

    raiserror @errno @errmsg

    rollback transaction

end

go

The expanded trigger code below shows the actual values that replace the macro variables used in the template code. Notice that the custom code that updates the PRODUCT table has been duplicated in every Child-Insert trigger attached to the ORDER_LINE table.

create trigger special_order_line_insert on

ORDER_LINE

  for INSERT

  as

/* INSERT trigger on ORDER_LINE */

/* default body for special_order_line_insert */

begin

  declare  @numrows int,

           @nullcnt int,

           @validcnt int,

           @ins_order_line_number CHAR(18),

           @ins_order_id CHAR(18),

           @errno   int,

           @errmsg  varchar(255)

  select @numrows = @@rowcount

/* ERwin Builtin Fri Apr 02 09:42:42 1997 */

  /* CUST_ORDER contains ORDER_LINE ON CHILD INSERT RESTRICT */

  if

    /* %ChildFK(“ or”,update) */

    update(order_id)

  begin

    select @nullcnt = 0

    select @validcnt = count(*)

      from inserted,CUST_ORDER

where

          /* %JoinFKPK(inserted,CUST_ORDER) */

          inserted.order_id = CUST_ORDER.order_id

    /* %NotnullFK(inserted,” is null”,”select @nullcnt =

count(*) from inserted where”,” or”) */

    if @validcnt + @nullcnt != @numrows

    begin

    select @errno  = 30002,

          @errmsg = ‘Cannot INSERT “ORDER_LINE” because “CUST_ORDER” does not exist.’

      goto error

    end

  end

/* ERwin Builtin Fri Apr 02 09:42:43 1997 */

  /* PRODUCT is requested on ORDER_LINE ON CHILD INSERT RESTRICT */

  if

    /* %ChildFK(“ or”,update) */

    update(product_model_number)

  begin

    select @nullcnt = 0

    select @validcnt = count(*)

      from inserted,PRODUCT

        where

          /* %JoinFKPK(inserted,PRODUCT) */

          inserted.product_model_number = PRODUCT.product_model_number

    /* %NotnullFK(inserted,” is null”,”select @nullcnt =

count(*) from inserted where”,” or”) */

    select @nullcnt = count(*) from inserted where

      inserted.product_model_number is null

    if @validcnt + @nullcnt != @numrows

    begin

      select @errno  = 30002,

             @errmsg = ‘Cannot INSERT “ORDER_LINE”

because “PRODUCT” does not exist.’

      goto error

    end

  end

  update PRODUCT from PRODUCT,inserted

      set product_sold_quantity = PRODUCT.product_

sold_quantity

           + inserted.order_quantity

      where

        inserted.product_model_number = PRODUCT.product_model_number

  return

error:

    raiserror @errno @errmsg

    rollback transaction

end

go


Using the Template Toolbox and Macros

The ERwin Template Toolbox provides a variety of predefined macros to help you customize the built-in trigger templates, create override RI trigger templates, or write new SQL triggers or stored procedures. The predefined macros, which begin with the percent (%) symbol, are expanded into table names and other variables when the physical database schema is generated.

The Template Toolbox contains three sections: a set of five macro list boxes on the left, a window that displays help about the selected macro in the center, and a static sample diagram on the right. The macros are divided into separate list boxes for table, relationship, attribute, constraint and miscellaneous macros to help you locate a particular macro more easily. Note that some of the macros appear in both the table and relationship list boxes.

If you click on a macro name and highlight it, ERwin displays help information about the highlighted macro in the center window. The help information about the selected macro includes syntax examples that use table and field names from the sample MOVIES.ER1 diagram. Click the Macro button at the top of this help window for more information on the ERwin template macros.

When you’re editing the macro code in the Template Code window, if you open the Template Toolbox and double-click on a macro name, ERwin inserts the macro at the last position your cursor occupied in the code window.

Note:	When you are editing the macro code in a Template Code window, you can freely use the arrow keys, spacebar, BACKSPACE, INSERT, DELETE, and other standard Windows text editing keys except TAB. You can insert a tab using CTRL+TAB.

Related Topics

  To open the Template Toolbox

  To insert a macro into a template code window


To open the Template Toolbox

•	Select <Database> Trigger Template on the Server menu, then click the Trigger Toolbox button.

OR

•	Click the Trigger Toolbox button in any of the other Template Editors.


To insert a macro into a template code window

1.	Select <Database> Trigger Template on the Server menu, or open any of the other Template Editors, then select the trigger you want to edit.

2.	Click in the template window at the position where you want to insert a macro.

3.	Click the Trigger Toolbox button.

4.	Locate the appropriate macro in the macro list boxes.

5.	Double-click on the macro name. ERwin inserts the macro into the template code.

6.	Click Close to close the Template Toolbox.


Schema Generation Options for Triggers

The following table lists the Trigger options in the Schema Generation Report Editor and explains how each control affects the DDL that ERwin generates.

Trigger Option	Description
ERwin Generated	Select this check box to include ERwin-generated RI triggers in the schema for all RI options.
RI Type Override	Select this check box to include either an RI Type Override trigger (if available) or ERwin-generated trigger in the schema for all RI options.
Relationship Override	Select this check box to include either a Relationship Override trigger (if available) or ERwin-generated trigger in the schema for all RI options.
User Defined	Select this check box to include Table Override triggers in the schema. If no other options are selected, Table Override triggers include the default ERwin-generated trigger code.
RI Type Override	Select this check box to include RI Type Override trigger code (if available) in Table Override triggers in the schema.
Relationship Override	Select this check box to include Relationship Override trigger code (if available) in Table Override triggers in the schema.


Using User-Defined Properties

In ERwin 3.5, you can define custom properties and assign them to the different classes of ERwin model objects. These user-defined properties (UDPs) are properties that you create to document and notate the following logical and physical object classes.

A user-defined property can be anything that you consider useful and important with respect to managing the specific object class. For example, imagine that you are a DBA in a workgroup setting where different developers have the responsibility for maintaining many tables. You can quickly design a user-defined property within the table editor that would allow each developer to select his or her name from a list box to specify that he or she is responsible for the selected table.

You can assign UDPs for any ERwin object class from within its respective editor (for example, the Entity Editor). All ERwin object editors have a UDP tab in which you can assign UDPs and open the UDP Editor. The ERwin Table Editor also has a UDP option on the shortcut menu that you can use to open the Table Editor and then choose the UDP tab. The UDP tab in all editors functions in exactly the same way. You can view each UDP name and complete the property values using the on-grid control.

From the Udps option in the Edit menu, or from any UDP tab, you can also open the UDP Editor to define the properties for the selected object class. In the UDP editor, you can assign a name, datatype, default value, and description for any UDP. Later, when you use the UDP tab in an object editor, the properties you defined in the UDP editor display for you to enter property values.

Keep in mind that UDPs lie outside the realm of the data model itself. That is, they do not get generated into your database. You design UDPs as a tool to help you better manage the many details of a data model. You can, however, use UDPs for UDP macros, and in the Report Browser to include UDPs in model object reports and report on UDP definitions.

Related Topics

  Creating User-Defined Properties

  Using UDP Macros


Creating User-Defined Properties

You can use the User-Defined Property (UDP) Editor to define properties that you can use for logical and physical ERwin objects, and macros.

The purpose of each control in the User-Defined Property Editor is explained below:

•	Class. Select the class of ERwin object to which you want to apply a UDP. The list selection always defaults to the diagram object from which you access the UDP editor (for example, Entity if you open the UDP Editor from the Entity Editor).

•	Name. Type the name of the UDP. This name later displays in the tab of the specific object editor as the UDP name.

•	Type. Select the datatype to use for the UDP.

•	Date. Use to enter dates in MM/DD/YY format. You can use the [image] to select a date from the drop-down calendar.

•	Int. Use to enter integer (whole) numbers.

•	Real. Use to enter real numbers (with decimal).

•	Text. Use to enter ASCII text.

•	List. Use to create a list box with user-defined choices. You can use the Default box to type a series of list choices.

•	Default. If applicable, type a default value that you want to appear as the UDP default. Using a default value is optional, but there are some rules when using the various datatypes:

•	Int, Real, and Text. Type the appropriate default value you want to appear when you want to assign a UDP.

•	List. You must enter default values since the List datatype requires that you type a series of list choices. You can separate each choice by a comma (,) and denote a default list value by preceding the default list entry with a tilde (~).

•	Date. Type a default date or use the date spin control to scroll though dates by month, day, and year. When you click on the [image] button, you can select a date from the drop-down calendar.

•	Description. Type a description of the UDP.

•	. Click to add a new row in the grid.

•	. Click to delete the selected row in the grid.

•	. Click to move the selected row up in the grid. Used to sort UDPs.

•	. Click to move row focus down in the grid control. Used to sort UDPs.

UDPs cannot be shared across the logical and physical model objects. For example, Entities and Tables cannot share UDPs. They must be defined separately. Only the Diagram, Relationship, Stored Display, and Subject Area editors can share UDPs across physical and logical models.

Related Topics

  To create a user-defined property

  Using User-Defined Properties

  Using UDP Macros


To create a user-defined property

1.	Select Logical, Physical or Dimensional from the model type list in the ERwin Toolbar. More>>

2.	Choose one of the following:

•	Choose Udps on the Edit menu.
The User-Defined Property Editor opens.

•	Depending on the model type, select any one of the following editors from the Edit menu:
Entity, Table, Column, Attribute, Key Group, Index, Domain Dictionary, Relationship, Diagram, Stored Display, or Subject Area.

3.	Click the UDP tab in the object editor.

4.	Click the Open Editor button [image] to open the UDP Editor.

5.	Click the [image] button to open a new row.

6.	Enter the user-defined property information in the following grid columns:

•	Name. Type a name for the UDP.

•	Type. Select a datatype from the list.

•	Default. Type a default UDP value.

•	Description. Type a UDP description. The text you enter, displays as a ToolTip when you later assign UDP values.

7.	Click OK to close the UDP Editor.

8.	You can enter a UDP value for your defined UDP.


Using UDP Macros

You can use the new UDP Macro functions to display UDP values in an ERwin diagram, triggers, and stored procedures. A macro is available for each ERwin model object class that supports UDPs.

ERwin Object Class	Corresponding Macro
Entity	%EntityProp(UDPName)
Table	%TableProp(UDPName)
Attribute	%AttProp(UDPName)
Column	%ColProp(UDPName)
Key Group	%KeyGroupProp(UDPName)
Index	%IndexProp(UDPName)
Logical Relationship	%RelLogProp(UDPName)
Physical Relationship	%RelPhysProp(UDPName)
Logical Domain	%DomainLogProp(UDPName)
Physical Domain	%DomainPhysProp(UDPName)
Subject Area	%SubjectAreaProp(UDPName)
Diagram	%DiagramProp(UDPName)
The UDPName macro argument is the UDP name that you define in the UDP Editor. For example, to define the department, you can create an Entity UDP called Department and assign “Accounting” as a UDP property value associated with an entity. You could then use the %EntityProp(Department) macro to display the UDP Department value (Accounting) in the diagram. Using macros like this can make diagrams more descriptive according to your own needs.

The following macro used in the Target Server Table Name Macro text box:

%EntityProp(Department) %EntityName()

displays in the physical diagram as:

Accounting_Employees (where Accounting is the department and Employees is the entity name.)

Related Topics

  Using User-Defined Properties

  Where to Use UDP Macros

  Creating User-Defined Properties


Where to Use UDP Macros

You can use UDP macros in the following ERwin UI objects:

ERwin Menu Option	ERwin Dialog	Text Box or Button
Edit / Domain Dictionary	ERwin Domain Dictionary Editor	Name Inherited by Attribute (Logical) Name Inherited by Column (Physical)
Edit / Trigger	ERwin Trigger Template Editor	<Database> Table Trigger <Database> Trigger Template
Server / <Database> Trigger Template	<Database> Trigger Template Editor	Trigger Toolbox
Server / <Database> Schema Property	ERwin Schema Script Template Editor Stored Procedure tab	Schema SP Template
Server / <Database> Schema Property	ERwin Schema Script Template Editor Pre & Postscript	Schema Script Template
Server / Target Server	ERwin Target Server Editor	Table Name Macro Index Name Macro
Note:	You can only use UDP macros in ERwin dialogs and text boxes where thay are relevant. For example, you cannot expect any change in the diagram table name by using an attribute UDP macro (AttProp() ) in the Target Server dialog Table Name text box. In this text box, you can use UDP macros like EntityProp(), TableProp(), or DiagramProp(). In this context, you can use combinations of these macros to make the diagram table names more descriptive.

Related Topics

  Using User-Defined Properties

  Using UDP Macros


Using ERwin Volumetrics

Using ERwin volumetrics, you can closely calculate the size of tables, indexes, and physical storage objects in your database.

When you calculate database size and growth, you can:

•	Forecast hardware requirements.

•	Evaluate the implications of database growth.

•	Create “what if...” scenarios based on server, physical object, column and table settings.

In ERwin, you can select any table and calculate its approximate size according to initial state or projected growth. After you calculate all table sizes in your database, you can easily calculate the approximate size of the entire database. In estimating the size of a database table, ERwin considers the datatypes that are native to the server you are using.

Using ERwin volumetrics, you can:

•	Manipulate server-specific column values such as NULL and variable-width columns that influence table size calculations.

•	Include index files in database calculations and select appropriate physical storage objects for each individual table in the database.

•	Modify various parameters that affect database size calculations. For example, you can change the number of bytes per character, adjust the amount of space overhead per row, and include a log space factor to account for database log space.

•	Use the ERwin Report Browser to print volumetrics reports by Physical Object, Database, and Table with appropriate totals.

•	Modify table calculation settings from within the Report Browser, and have the Report Browser calculate database size in real-time.

Related Topics

  Using the Volumetrics Editor

  Calculating Table and Database Size

  Using the Table Editor

  Using the Column Editor


Using the Volumetrics Editor

You can use the Volumetrics Editor to closely calculate the physical size of tables, indexes, and physical storage objects in a table and in a database.

The purpose of each tab in the Volumetrics Editor is explained below:

•	Settings. Use to select each database table and assign estimates for initial and projected values, column properties, physical storage objects, and index types. ERwin calculates table size estimates in real-time as you enter table, column, and physical storage information.

•	Report. Use to report on the database by physical objects, database objects, or tables according to your table settings above. You can report on the initial size or projected future database size based on your estimated monthly row (record) growth. You can use the ERwin Report Browser to print reports and perform new calculations.

•	Parameters. Use to set various calculation factors to “inflate” or “deflate” the database calculations that are based on your table settings.

Related Topics

  Calculating Table and Database Size

  Reporting Volumetric Calculations

  Setting Volumetrics Calculation Parameters

  Using ERwin Volumetrics


Calculating Table and Database Size

To accurately calculate the size of database tables, you must estimate table and row size information in the Settings tab of the Volumetrics Editor.

The purpose of each control in the Settings tab in the Volumetrics Editor is explained below:

•	Table Row Counts. Type the row counts for the Initial, Grow By, and Max text boxes as accurately as possible. These entries have the greatest effect on the calculated table size.

•	Initial. Type an initial number of records for the selected table. The Sizing Estimates group box in the lower left corner of the dialog immediately displays the estimated table, index, and average row size.

•	Max. If the table has a record limit, type the maximum allowable number of records that the table is designed to hold. You can leave Max blank for open ended growth. This option is most useful when used with Grow By (see below). When used together, you can know when a table will reach its designed record limit.

•	Grow By. If you are calculating table growth, type the estimated number of records that you expect the table to grow by per month. You can then generate reports on future table and database growth. If you have a maximum record number in the Max (see above) text box, table growth will stop at that record number.

•	Column Properties. Review the table columns, datatypes, and allocated width. You can enter any estimated values for Avg Width and Pct. NULL column cells that are available (not dimmed). For your selected server, ERwin automatically knows the column datatypes that vary in width and in size, with or without NULL assignments. If a column cell is unavailable, the column datatype is not variable width as defined by the selected target server.

•	Avg. Width. Type an estimated average width for that column. For example, if a variable width ADDRESS column is assigned a width of 50 characters, you can still enter 20 as the average character width of the column. For variable-width datatypes such as VARCHAR2 in Oracle, when you assign an average width, the value automatically becomes the allocated width in the Alloc grid box.

•	Pct. NULL. Type, using a whole number, the estimated percentage of nulls used for that column. For example, you can estimate an optional ADDRESS 2 column having a width of 50 characters, to be NULL about 30 percent of the time.

•	Include Indexes. Select the FK (Foreign Key), PK (Primary Key), AK (Alternate Key), or IE (Inverse Entry) indexes that you want to include in each table calculation. The selected index file sizes are automatically calculated when you enter values in the Table Row Counts group box.

•	Storage. From the Physical Object list, select the physical storage object name you are using for the selected table. You can also click on the Open Editor button [image] to open the Physical Object Editor. If applicable to your server, you can assign different files to different storage objects.

•	Sizing Estimates. Use to view the average row size, initial table size, and initial size of all indexes for the selected table. These values are calculated in real-time as you enter size estimates. You can use the Report tab to report on the total database size estimate.

Related Topics

  To calculate table and database size

  Using the Table Editor

  Using the Column Editor


To calculate table and database size

1.	Choose Volumetrics on the Edit menu.

2.	Click the Settings tab.

3.	Select a table in the Table list which you want to apply calculation settings.

4.	Type the applicable table values in the Initial, Max, and Grow By text boxes.

5.	Type the average width and percent null figures in the Avg Width and Pct NULL boxes.

6.	In the Storage group box, select the physical storage object from the Physical Object list.

7.	Select the index types (PK, AK, FK, IE) you want to include in the database calculation, in the Include Indexes group box.

8.	Repeat steps 2 - 7 for each table in the database.

9.	Click the Report tab to generate a report with table and database totals. More>>

Note: Table size estimates display in real-time in the Sizing Estimates group box.


Reporting Volumetric Calculations

When you finish specifying the column and table settings for a database in the Settings tab of the Volumetrics editor, you can click on the Report tab in the Volumetrics editor and select a report type. Then, you can send the calculation data to the Report Browser for additional formatting and to execute result sets.

The purpose of each control in the Report tab is explained below:

•	Physical Objects. Select to display the volumetric report grouped by physical storage object.

•	Database Objects. Select to display the volumetric report grouped by database object.

•	Tables. Select to display the volumetric report grouped by table.

•	Initial. Select to display the volumetric report using initial table row size.

•	Projections. Select to display a volumetric report using projected table values. You can select the projected number of months in the Months list. The projection uses the Grow By estimate in the Settings tab.

Related Topics

  To define a volumetrics report

  To send volumetrics calculations to the Report Browser

  To perform volumetrics calculations in the Report Browser

  Using the Report Browser with ERwin


To define a volumetrics report

1.	In the Volumetrics Editor, click on the Report tab.

2.	Select the Physical Objects, Database Objects, or Tables option.

3.	Select the Initial or Projections option.

•	If you select Projections, select the number of months from the Months list.

4.	View the object size calculations in the Physical Objects list.

5.	To send and execute the volumetrics report to the Report Browser, click the Send to Report Browser button.


To send volumetrics calculations to the Report Browser

1.	Define a volumetrics report. More>>

2.	Click the Send to Report Browser button.


To perform volumetrics calculations in the Report Browser

1.	In the Report Browser, open the ERwin Volume Reports folder. More>>

2.	Right-click on the Physical Object Calculations, Database Object Calculations, or Table Calculations report and select Execute Report <report name>.

3.	In the Report Options dialog, Select the Initial or Projections option.

•	If you select Projection, select the number of months from the Months list.

4.	In the Include Indexes group box, select the check boxes for the index types that you want to include in your report . Clear the check boxes for the index types that you do not want to include in your report.

5.	Click OK.


Setting Volumetrics Calculation Parameters

In the Parameters tab of the Volumetrics Editor, you can set calculation parameters that affect the size of tables in a database.

The purpose of each parameter is explained below:

•	TableFactor. Use this factor to include the overhead that the database requires to store a table. The TableFactor is multiplied by the calculated size of a table. For example, a TableFactor of 1.2 would inflate a calculated 1 megabyte database to a 1.2 megabyte database.

•	IndexFactor. Use this factor to include the overhead that the database requires to store indexes. The IndexFactor is multiplied by the calculated size of indexes included in the calculation. For example, an IndexFactor of 1.5 would inflate a calculated 1 megabyte index to be a 1.5 megabyte index.

•	RowOverhead. Use this option to add additional overhead bytes to each table row. This value is added to the number of calculated bytes per table row. For example, if a row is calculated to require 100 bytes, and the RowOverhead is 8 bytes, each table row will be calculated to be 108 bytes.

•	BlobFactor. Similar to the TableFactor, you can use this factor to include the overhead for column objects stored “out of table”. The BlobFactor is multiplied by the assigned column width.

•	BlobBlockSize. The block size for data stored “out of table”. This is a DBMS and sometimes OS specific value.

•	BytesPerChar. Use this factor to change the number of bytes used per column character. For ASCII this value is 1, but for a multi-byte character set, such as UNICODE, the number of bytes used per column character is 2.

•	LogPercent. Use this factor to account for database log files. Expressed as a percentage of the calculated database size, the LogPercent is multiplied by the calculated size of the entire database, which is the total of database tables, indexes and storage objects. For example, a LogPercent of 100 doubles the calculated size of the database.

Related Topics

  To set volumetrics database parameters

  Using the Volumetrics Editor


To set volumetrics database parameters

1.	Choose Volumetrics on the Edit menu.

2.	Click the Parameters tab.

3.	Type a parameter value in the any of the following text boxes:

•	TableFactor

•	IndexFactor

•	RowOverhead

•	BlobFactor

•	BlobBlockSize

•	BytesPerChar

•	LogPercent

4.	Click Close.


Working With Attributes, Key Groups, and Logical Domains

Once you have discovered the people, places, and events that define the entities in your model, you can begin to fill out the definition by listing the information that you want to track for each entity. For example, you may want to track information on customers in your model. Once you create the CUSTOMER entity, you can begin to define the individual pieces of information you want to track for each customer, including the customer name, customer address, and customer phone number. Each of these pieces of information is saved in ERwin as an attribute of the CUSTOMER entity.

Using ERwin, you can define attribute properties, such as the name or definition of the attribute, in the Attribute Editor. ERwin also provides domains, which are simply a shortcut method for assigning a set of properties, such as the logical datatype, to an attribute. Once you define a domain in the Domain Dictionary, it is available in the Independent Attribute Browser. To speed the construction of your model, you can automatically specify all attribute properties by assigning a domain to the attribute in a single action by either: dragging the independent attribute from the Independent Attribute Browser to an entity or attaching the domain to the attribute in the Attribute Editor.

Determining key group attributes is an important task in developing a logical model. A key group is one or more attributes that either:

•	Define a unique key for the data represented by the entity, such as a customer number or define a non-unique key for the data that is used for data access, such as a customer last name.

While the identification of non-unique keys is not required in the logical model, it is useful for capturing user requirements for data access. These non-unique key groups can then be indexed in the physical model to improve the performance of queries.

ERwin provides support for both on-diagram editing of attribute properties, as well as editor-based management of attributes, domains, and key groups.

Related Topics

  On-Diagram Editing of Attributes

  Using the Attribute Editor

  Using Logical Domains

  Working with Key Groups

  Using the Key Group Editor


On-Diagram Editing of Attributes

As you design a data model, the names of objects such as entities, attributes, relationships, and text blocks may frequently change and objects may be added or deleted. Instead of opening an editor each time you want to change an object’s name, or add or delete an object, you can edit objects directly in the Diagram window.

To change an object’s name in the Diagram window, click on the [image] or [image], select the object that you want to change, then click on the selected object again. (Do not double-click as you normally would to open the object’s editor.) ERwin displays the name of the selected object in an outlined edit box. Use the appropriate key (e.g., BACKSPACE or DELETE) to erase all or part of the old name, and then type the new name in the edit box.

After editing an object’s name, press SHIFT+ENTER to save your changes. ERwin changes the object’s name and automatically adjusts the height or width, or both of the entity box to fit the new information. Unless you set the Entity Size option to a specific height or width or both. See Adjusting the Size of Entities, Tables, and Views for more information.

You can also add attributes directly in the Diagram window. To add an attribute, select the attribute just above where you want to insert a new attribute, click on the attribute again to open the edit box, and then press ENTER. ERwin inserts an edit box below the selected attribute. Type the new attribute’s name in the edit box and press SHIFT+ENTER to save your changes, or press ENTER to add another attribute to the entity. If the original attribute you select is above the line in the entity box, ERwin adds the new attribute as a primary key attribute. Similarly, if you select an attribute below the line, ERwin adds the new attribute as a non-key attribute.

When you edit an entity or attribute name, you can change other objects in the same entity. For example, if you change the name of the entity, you also might want to change the name of one or more attributes in the same entity. To continue editing the next object in an entity, use the TAB key or the DOWN ARROW key (↓).

Note:	If you change the name of a foreign key using on-diagram editing, ERwin treats the new name as a rolename. See Defining Attribute Rolenames for more information.

Also, when you add or change attribute names using on-diagram editing and assign a domain to the attribute, the Name Inherited by Attribute does not automatically migrate; ERwin treats the name added using on-diagram editing as an override.

Related Topics

  To change an object's name in the Diagram window

  To add an attribute or column in the Diagram window

  To add an Attribute using the Independent Attribute Browser

  Summary of On-Diagram Editing


To add an attribute or column in the Diagram window

1.	Click [image].

2.	Click on the attribute or column name directly above where you want to place the new attribute or column, wait a moment, then click again.

3.	Press ENTER.

4.	Type the name of the new object.

5.	Choose one of the following options:

•	To save your changes, press SHIFT+ENTER.

•	To add another attribute or column to the entity, press ENTER.

Tip:	You can press the ESC (Escape) key to cancel a change.


To add an Attribute using the Independent Attribute Browser

1.	If the Independent Attribute Browser is hidden, press CTRL+B.

2.	Click [image] or [image].

3.	Click on a Independent Attribute and drag it into an entity to create an attribute owned by the entity. The new attribute inherits all of its properties from the independent attribute, including the name.

4.	Modify any attribute properties in the Attribute Editor. More>

Tip:	You can change the attribute name using on-diagram editing. More>


To change an object's name in the Diagram window

1.	Click [image].

2.	Click on the object name that you want to change, wait a moment, then click again.

3.	Use the BACKSPACE or DELETE key to erase some or all of the old name.

4.	Type the new name.

5.	Choose one of the following options:

•	To save your changes, press SHIFT+ENTER.

•	To go to the next attribute name in an entity, press the TAB key

Tip:	You can press the ESC (Escape) key to cancel a change.


Summary of On-Diagram Editing

To…	Then…
Edit an entity, table, or view name	Click [image] or [image], click on the name, then click again.
Edit an attribute or column name	Click [image], click on the name, then click again.
Insert a new attribute or column	Edit a name, press TAB to move the cursor to the place you want to insert the new attribute, then press the ENTER key.
Edit a text block	Click [image], click on the text block, then click again.
Move to the next object in the same entity	TAB or DOWN ARROW (↓)
Move to the previous object in the same entity	SHIFT+TAB or UP ARROW (↑)
Save your changes to the diagram object	Press SHIFT+ENTER or CTRL+ENTER
Cancel your changes	Press ESC (Escape)
Related Topics:

  On-Diagram Editing of Attributes

  To add an attribute or column in the Diagram window

  To change an object's name in the Diagram window


Using the Attribute Editor

You can create and maintain attribute properties for all entities in the diagram with the Attribute Editor. You can also specify values for user-defined properties.

When you choose Attribute on the Edit menu, or Attribute Editor on the Entity shortcut menu, ERwin displays the Attribute Editor.

The purpose of each control in the Attribute Editor is explained below:

•	Entity. Displays the name of the entity that contains the attribute(s) of interest. To view the attributes in another entity, select a different entity name from the list.

•	 (Entity). Click this button to open the Entity Editor.

•	Attribute. Displays the names of all attributes in the current entity. Attributes that are part of the primary key have the key symbol [image] before the attribute name.

•	. Moves the selected attribute up one position in the entity.

•	. Moves the selected attribute down one position in the entity.

•	New. Click this button to open the New Attribute dialog and add an attribute.

•	Rename. Click this button to open the Rename Attribute dialog and edit the name of the selected attribute.

•	Delete. Deletes the selected attribute.

•	Migrate. Click this button to open the Migrate Attribute Properties dialog and select which primary key properties you want to migrate to related foreign key attributes. See Migrating Attribute Properties for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The Attribute Editor includes the following tabs:

•	General. Manage the domain, primary key, and logical/physical model display properties for the selected attribute.

•	Definition. Type a definition for the selected attribute.

•	Note. Type a note for the selected attribute.

•	UDP. Specify a user-defined property value for the selected attribute.

•	Key Group. Manage membership in key groups, such as alternate keys or inversion entries, for the selected attribute.

Note:	When you select a different attribute in the Attribute list, any property changes you made to the previously selected (highlighted) attribute can still be canceled by clicking the Cancel button. However, if you switch to another entity, the attribute property changes are implemented in the model and pressing the Cancel button does not cancel the earlier changes.

Related Topics

  To add an attribute to an entity in the Attribute Editor

  To add an Attribute using the Independent Attribute Browser

  To modify or delete an attribute

  To change the order of attributes in the Attribute Editor


To add an attribute to an entity in the Attribute Editor

1.	Right-click on an entity to which you want to add an attribute, then choose Attribute Editor on the shortcut menu.

2.	Click New.

3.	Type the name of the attribute in the Attribute text box.

4.	Click OK to close the New Attribute dialog.

5.	Click [image] or [image] to reposition the attribute in the Attribute list.

6.	Click OK.


To modify or delete an attribute

1.	Right-click on an entity that contains the attribute, then choose Attribute Editor on the shortcut menu.

2.	Select the attribute you want to delete.

3.	Click Delete.

4.	Click OK.

Tip:	You can also delete an attribute in the diagram window. Select the Attribute Manipulation tool [image], click on the attribute you want to delete, then press the DELETE key. Click Yes to confirm the deletion.


To change the order of attributes in the Attribute Editor

1.	Right-click on an entity that contains the attribute, then choose Attribute Editor on the shortcut menu.

2.	Select the attribute you want to move.

3.	Click [image] or [image] to position the new attribute in the Attribute list.

4.	Click OK.


Attaching a Domain to an Attribute

You can use the controls on the General tab of the Attribute Editor to view and update the general information about the attribute.

The purpose of each control in the General tab is explained below:

•	Alphabetically. Click this button to sort the domains in alphabetical order.

•	Hierarchically. Click this button to sort the domains in hierarchical order.

•	Domain. Select a domain from the list to attach it to the selected attribute. When you attach a domain to an attribute, you are specifying the logical datatype for the selected attribute. Standard logical datatypes included with ERwin are:  <unknown>, [image] Blob, [image] Datetime, [image] Number, and [image] String. This list can also include user-defined logical datatypes that you can also assign to the selected attribute.

When you attach a domain to an attribute, any physical model properties that are assigned to the domain are automatically inherited by the related column, as well. For example, a Money logical datatype can be assigned to an attribute, which can then optionally inherit its definition from that domain. ERwin automatically attaches the same domain, Money, to the corresponding column in the physical model, which then inherits characteristics such as datatype and null option from the domain.

•	. (Domain). Click this button to open the Domain Dictionary Editor (logical edit mode).

•	Logical Only. Select this check box if you want the selected attribute to appear in the logical model only. Clear this check box if you want the selected attribute to have a corresponding column in the physical model.

•	Primary Key. Select this check box if you want the selected attribute to be included in the primary key. Clear this check box if you want the attribute to be a non-key attribute.

•	Required. Select this check box to specify that the selected non-key attribute is a required field in a data entry application. This check box is automatically selected for all primary key attributes. Clear this check box if the attribute is not a required field in a data entry application. This option corresponds to the NULL and NOT NULL options in a physical model.

Related Topics

  Using the Attribute Editor

  Using the Domain Dictionary Editor in the Logical Edit Mode

  To assign a domain to an attribute


To assign a domain to an attribute

1.	Right-click on an entity that contains the attribute, then choose Attribute Editor on the shortcut menu.

2.	Select the attribute name in the Attribute list.

3.	Click the General tab.

4.	Select the domain name from the Domain list that you want to assign to the attribute.

5.	Click OK.


To create a primary key attribute

1.	Right-click on an entity that contains the attribute, then choose Attribute Editor on the shortcut menu.

2.	Click the New button.

3.	Select a domain from the Attribute Parent list on which to base the attribute.

4.	Type a name for the attribute in the Attribute Name text box. Optionally in the Column Name text box, type a different name for the corresponding column in the physical model.

5.	Click OK.

6.	Select the new attribute name in the Attribute list.

7.	Click the General tab.

8.	Select the Primary Key check box.

9.	Click OK.


Specifying an Attribute Definition

Using the Definition tab of the Attribute Editor, you can record a definition for each attribute in your model. A definition included in the logical model for an attribute is automatically copied to the comment for the corresponding column in the physical model.

The purpose of each control in the Definition tab is described below:

•	Definition. Type or edit the definition for the selected attribute.

•	 Cuts, copies, and pastes text using the Clipboard.

•	 Opens the ERwin Text Editor.

Note:	If you want to create a distinct definition in both the logical and physical model. Click the Comment tab of the Column Editor and clear the Update Attribute Definition to Match option.

Related Topics

  To add or update an attribute definition

  Using the Column Editor


To add or update an attribute definition

1.	Right-click on an entity that contains the attribute, then choose Attribute Editor on the shortcut menu.

2.	Click the Definition tab.

3.	Perform one or more of the following actions:

•	To create a new definition, type a new definition in the Definition text box.

•	To edit an existing definition, use the standard keyboard editing keys to add or delete text in the Definition text box.

•	To edit the definition in a larger window, click [image].

4.	Click OK.


Specifying an Attribute Note

Using the Note tab of the Attribute Editor, you can record additional notes for each attribute in your model.

The purpose of each control in the Note tab is described below:

•	Note. Type or edit a note for the selected attribute.

•	 Cuts, copies, and pastes text using the Clipboard.

•	 Opens the ERwin Text Editor.

Related Topics

  To enter an attribute note


To add or update an attribute note

1.	Right-click on an entity that contains the attribute, then choose Attribute Editor on the shortcut menu.

2.	Click the Note tab.

3.	Choose one or more of the following:

•	To create a new note, type the new text in the Note text box.

•	To edit an existing note, use the standard keyboard editing keys to add or delete text.

•	To edit the note in a larger window, click [image].

4.	Click OK.


Specifying Attribute UDP Values

After you create UDPs for attributes in the UDP Editor, you can easily specify property values for attributes in the UDP tab of the Attribute Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP for you to select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Attribute Editor

  To specify attribute UDP values

  Creating User-Defined Properties


To specify attribute UDP values

1.	Define an attribute user-defined property. More>>

2.	Select Attribute from the Edit menu.

3.	Click on the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Assigning Key Group Membership in the Attribute Editor

Using the Key Group tab of the Attribute Editor, you can specify key group membership for each attribute in your model. Primary key and foreign key groups are maintained automatically by ERwin, based on the position of the attribute in the entity (in the key or non-key area) or, in the case of foreign keys, through new and existing entity relationships.

You can easily add or remove attributes from the primary, alternate, or inversion entry key groups using the controls on the Key Group tab.

The purpose of each control in the Key Group tab is explained below:

•	Key Group Membership. Lists all key groups defined for the current entity. An X appears in the box next to the key group name if the selected attribute is a member. Select the check box next to a key group name to assign the selected attribute to that key group. Clear the check box next to a key group name to remove the attribute from the key group. Changing the primary key assignment has additional effects:

•	If you add the primary key designation, ERwin moves the attribute to the key area of the entity.

•	If you remove the primary key designation, ERwin moves the attribute to the non-key area of the entity.

•	. (Key Group Membership). Click this button to open the Key Group Editor. See Using the Key Group Editor for more information.

•	Show FK Groups. Select this option to display foreign key groups in the Key Group Membership list. Clear the option to hide foreign key groups. You cannot change attribute membership in a foreign key group directly. You must instead add or remove attribute members in the primary key of the parent entity from which the foreign key group migrates.

Note:	Key groups correspond to unique and non-unique indexes in the physical model. See Using the Index Editor for more information on index properties.

Related Topics

  Using the Attribute Editor

  To add or remove attribute key group membership


To add or remove attribute key group membership

1.	Right-click on an entity that contains the attribute, then choose Attribute Editor on the shortcut menu.

2.	Select the attribute name in the Attribute list that you want to add to a key group.

3.	Click the Key Group tab.

•	To add an attribute to a primary, alternate, or inversion entry key group, select the check box next to the key group name.

•	To remove an attribute from a key group, clear the check box next to the key group name.

4.	Click OK.

Note:	You cannot change attribute membership in a foreign key group directly. You must instead add or remove attribute members in the primary key of the parent entity from which the foreign key group migrates.


Migrating Attribute Properties

When you create a relationship in a logical model, ERwin automatically migrates the primary key attributes of the parent entity into the child entity as foreign keys. By default, all properties of the primary key are migrated to the foreign key in the child entity. You can also choose which attribute properties migrate with the foreign key for each relationship in your model.

When you click the Migrate button in the Attribute Editor, ERwin opens the Migrate Attribute Properties dialog.

The purpose of each control in the Migrate Attribute Properties dialog is described below:

•	Attribute Domain. Select this option if you want to migrate attached domains to an FK attribute.

•	Name. Select this option if you want to migrate the PK attribute name to an FK attribute.

•	Logical Only. Select this option if you want to migrate the PK attribute “logical only” property to an FK attribute.

•	Definition. Select this option if you want to migrate the PK attribute definition to an FK attribute.

•	Note. Select this option if you want to migrate the PK attribute note to an FK attribute.

•	UDP. Select this option if you want to migrate the PK attribute user-defined property (UDP) to an FK attribute.

•	Icon. Select this option if you want to migrate the PK attribute icon to an FK attribute.

•	OK. Click this button to close the dialog. When you close the Attribute Editor, ERwin automatically cascades all the appropriate attribute property information to foreign keys in child entities throughout the diagram.

•	Cancel. Click this button to close the dialog and cancel your changes.

Note:	The Migrate Attribute Property options should be used with care because the migrated properties override any previous attribute property settings assigned to the foreign keys, including properties assigned by an associated domain, or a specific override for a particular attribute.

Related Topics

  To migrate attribute properties to foreign key attributes


To migrate attribute properties to foreign key attributes

1.	Right-click on the entity that contains the primary key attributes, then choose  Attribute Editor on the shortcut menu.

2.	Select a primary key attribute from the Attribute list.

3.	Click the Migrate button.

4.	Choose one or more of the following options:

•	To migrate the domain, select the Attribute Domain option.

•	To indicate which properties you want to migrate from the selected primary key attribute to the related foreign key attributes in child entities, click one or more of the attribute property check boxes.

5.	Click OK.


Working with Key Groups

A key group is a logical modeling tool that you use to identify:

•	Relationships between entities, that are implemented as foreign keys. A foreign key appears in a child entity and represents the migration of the primary key of the parent entity to the child entity.

•	Potential primary keys or alternate keys for use in the physical model. Primary and alternate keys are unique keys created from one or more attributes that uniquely identify a single instance in an entity. For examples, unique keys in the customer entity may include customer number, social security number, or first and last name plus telephone number.
From the list of available unique keys, you can select the primary key that most efficiently accesses database information. You can, for example, create a surrogate key, such as customer number, to increase database access efficiency. (See the ERwin Method’s Guide for more information on primary, alternate, and surrogate keys.)

•	Potential inversion entry keys in the logical model. An inversion entry key comprises one or more attributes that are frequently used to access information in the entity, but are non-unique. An example of a useful inversion entry is customer last name. Although you may have many customers with the same last name, it is useful to look up information for a customer using their last name instead of their customer number.

You can define primary keys, alternate keys, foreign keys, and inversion entries in your logical model. If you create a physical model from the logical model, any or all of the keys can subsequently appear as indexes for the corresponding tables in the physical model. See Working with Indexes for more information.

Related Topics

  Using the Key Group Editor

  Assigning Key Group Membership in the Attribute Editor

  Assigning Index Membership

  Foreign Key Migration


Using the Key Group Editor

You can create and maintain key group properties with the Key Group Editor. When you choose Key on the Edit menu or Key Group Editor on the Entity shortcut menu ERwin displays the Key Group Editor.

The purpose of each control in the Key Group Editor is explained below:

•	Entity. Displays the name of the entity that contains the key group(s) of interest. To view the key groups in a different entity, select a different entity name from the list.

•	.(Entity). Click this button to open the Entity Editor.

•	Key Group. Displays the names of all key groups defined for the current entity.

•	Show FK Groups. Select this option to display foreign key groups in the Key Group list. Clear the option to hide foreign key groups. A foreign key group is the result of migrating a primary key through an entity relationship.

•	New. Click this button to open the New Key Group dialog and add a key group.

•	Rename. Click this button to open the Rename Key Group dialog and edit the name of the selected key group.

•	Delete. Deletes the selected key group. This control is unavailable (dimmed) when you select a primary key group or foreign key group in the Key Group list.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The Key Group Editor includes the following tabs:

•	Members. Manage membership in key groups and the order of member attributes.

•	General. Manage the key group type for the selected key group. Controls on this tab are unavailable (dimmed) when you select a primary key group or foreign key group in the Key Group list.

•	Definition. Type a definition for the selected key group.

•	Note.  Type a note for the selected key group.

•	UDP. Specify a user-defined property value for the selected key group.

Note:	When you select a different key group in the Key Group list, any property changes you made to the previously selected (highlighted) key group can still be canceled by clicking the Cancel button. However, if you switch to another entity, the key group property changes are implemented in the model and pressing the Cancel button does not cancel the earlier changes.

Related Topics

  To create an alternate or inversion entry key group

  To rename a key group

  To delete a key group


To create an alternate or inversion entry key group

1.	Right-click on an entity, then choose Key Group Editor on the shortcut menu.

2.	Click New.

3.	Optionally, replace or modify the default name for the key group in the Key Group text box.

4.	Choose one of the following options in the Key Group Type group box:

•	To create an alternate key, click the Alternate Key (unique) button.

•	To create an inversion entry, click the Inversion Entry (non-unique) button.

5.	Click OK.

6.	Click the Members tab.

7.	Select one or more attributes in the Available Attributes list, then click [image].

8.	Click OK.


To rename a key group

1.	Right-click on an entity, then choose Key Group Editor on the shortcut menu.

2.	Select the key group you want to rename in the Key Group list.

3.	Click Rename.

4.	Edit the name for the key group in the Key Group text box.

5.	Click OK to close the Rename Key Group dialog.

6.	Click OK.


To delete a key group

1.	Right-click on an entity, then choose Key Group Editor on the shortcut menu.

2.	Select the key group you want to rename in the Key Group list.

3.	Click Delete.

4.	Click OK.


Managing Member Attributes in the Key Group Editor

Using the Members tab of the Key Group Editor, you can select and manage the member attributes of the key groups defined for the current entity.

The purpose of each control on the Members tab is explained below:

•	Available Attributes. Lists all attributes in the entity that do not participate in the selected key group.

•	Key Group Members. Lists all attributes in the entity that participate in the selected key group.

•	. Moves the selected attribute up one position in the Key Group Members list.

•	. Moves the selected attribute down one position in the Key Group Members list.

•	. Moves the selected attribute from the Available Attributes list to the Key Group Members list.

•	. Moves the selected attribute from the Key Group Members list to the Available Attributes list.

Related Topics

  Using the Key Group Editor

  To change attribute key group membership in the Key Group Editor


To change attribute key group membership in the Key Group Editor

1.	Right-click on an entity, then choose Key Group Editor on the shortcut menu.

2.	Select the key group you want to modify in the Key Group list.

3.	Click the Members tab.

4.	Choose one or more of the following options:

•	To add an attribute to the key group, select one or more attributes in the Available Attributes list and click [image].

•	To remove an attribute from the key group, select one or more attributes in the Available Attributes list and click [image].

•	To change the order of attributes in the key group, select one or more attributes in the Key Group Members list and click [image] or [image].

5.	Click OK.


Specifying Alternate or Inversion Entry Keys

Using the General tab of the Key Group Editor, you can specify whether new or existing key groups are alternate keys, which represent a unique list of values in the selected table, or inversion entries, which represent a non-unique list of values in the selected table. The controls on this tab are unavailable (dimmed) when you select the primary key or foreign key in the Key Group list.

The purpose of each control in the General tab is explained below:

•	Primary Key. Indicates whether the selected key group is the primary key for the current entity.

•	Alternate Key (unique). Indicates whether the selected key group is an alternate key for the current entity. Click this button to change an inversion entry key group to an alternate key group.

•	Inversion Entry (non-unique). Indicates whether the selected key group is an inversion entry key group for the current entity. Click this button to change an alternate key group to an inversion entry key group.

•	Foreign Key. Indicates whether the selected key group is the foreign key for the current entity.

•	Logical Only. Select this check box if you want the selected alternate key or inversion entry to appear in the logical model only. Clear this check box if you want the selected alternate key or inversion entry to appear in the physical model as an AK or IE index.

Related Topics

  Using the Key Group Editor

  To specify whether a key group is unique or non-unique

  To specify a key group as logical-only


To specify whether a key group is unique or non-unique

1.	Right-click on an entity, then choose Key Group Editor on the shortcut menu.

2.	Select the key group you want to modify in the Key Group list.

3.	Click the General tab.

4.	Choose one of the following options:

•	To create a unique, alternate key group, click the Alternate Key (unique) button.

•	To create a non-unique, inversion entry key group, click the Inversion Entry (non-unique) button.

5.	Click OK.


To specify a key group as logical-only

1.	Right-click on an entity, then choose Key Group Editor on the shortcut menu.

2.	Select the key group you want to modify in the Key Group list.

3.	Click the General tab.

4.	Select the Logical Only check box.

5.	Click OK.


Specifying a Key Group Definition or Note

Using the Definition and Note tabs of the Key Group Editor, you can specify a definition or note for the selected key group.

The purpose of each control on the Definition and Note tabs is explained below:

•	Definition. Type or edit the definition for the selected key group.

•	Note. Type or edit a note for the selected key group.

•	 Cuts, copies, and pastes text using the Clipboard.

•	 Opens the ERwin Text Editor.

Related Topics

  Using the Key Group Editor

  To specify a key group definition

  To specify a key group note


To specify a key group definition

1.	Right-click on an entity, then choose Key Group Editor on the shortcut menu.

2.	Select the key group you want to modify in the Key Group list.

3.	Click the Definition tab.

4.	Type or edit a definition for the key group in the Definition text box.

5.	Click OK.


To specify a key group note

1.	Right-click on an entity, then choose Key Group Editor on the shortcut menu.

2.	Select the key group you want to modify in the Key Group list.

3.	Click the Note tab.

4.	Type or edit a note for the key group in the Note text box.

5.	Click OK.


Specifying Key Group UDP Values

After you create UDPs for a key group in the UDP Editor, you can easily specify property values for the key group in the UDP tab of the Key Group Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP for you to select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Key Group Editor

  To specify key group UDP values

  Creating User-Defined Properties


To specify key group UDP values

1.	Define a key group property. More>>

2.	Select Key Group from the Edit menu.

3.	Click on the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Working with Columns and Domains

The work of adding and maintaining columns in a table is significantly more complex than just typing and updating the column name. You must assign numerous physical properties to the column to complete its description, including datatype, null option, defaults, validation rules, volumetrics, comments, user-defined properties, display properties, and even storage properties for some target servers. You can manage all of these column properties in an ERwin model in a single place: the Column Editor.

In addition to specifying column properties in the Column Editor, you can also assign datatype, edit masks, and other column properties using the ERwin Domain Dictionary to define domains. An ERwin domain is a named set of column properties that you can attach to one or more columns in a model in order to quickly and accurately define their properties.

Once you define a domain, it is available in the Independent Column Browser and the steps required to assign specific properties to a column are combined into a single action: either dragging the independent column from the Independent Column Browser to a table or attaching the domain to the column in the Column Editor.

Related Topics

  Assigning Column Properties

  Using the Column Editor

  Migrating Column Properties

  Using the Display Format Editor

  Using ERwin Domains

  Using the Domain Dictionary Editor in a Physical Model

  Resetting Column Properties to the Domain Defaults

  Resetting Domain Properties to the Parent Domain


Assigning Column Properties

You can assign properties to a column in several ways, including:

•	Assigning Column Properties in the Column Editor. You can assign new values or override any default value attached to the column using the Column Editor.

•	Setting Column Property Defaults When Selecting a Target Server. ERwin automatically assigns a default datatype and null option to new columns based on the default settings in the Target Server Editor and whether or not the new columns are part of the primary key. For example, if you set the default datatype for new columns to CHAR(10) in the Target Server Editor, new columns are automatically assigned the CHAR(10) datatype.

•	Attaching a Domain to a Column. To speed up the process of defining physical column properties, you can group a set of column properties together in the Domain Dictionary Editor and save them as a domain. Once you create a domain, it is available as an independent column in the Independent Column Browser. You can quickly create columns in your tables by dragging and dropping independent columns from the Independent Column Browser to tables. All physical inheritable domain properties, including the name, are inherited by the new column. You can also assign domain properties to a given column simply by associating the column name with the domain name while in the General tab of the Column Editor. The column’s name is not automatically overwritten by attaching the domain to the column.

•	Switching between Logical and Physical Models. If you have created entities and attributes in a logical model, ERwin automatically creates equivalent tables and columns in the physical model. Columns that are generated in this way are assigned the attribute name (with spaces and reserved characters replaced by underscores) and a datatype, based on the domain assigned to the attribute in the logical model.

•	Migrating Column Properties through FKs. When you create a relationship between tables, the FK columns migrate to the child table. You can choose to also migrate any or all of the associated column properties with the migrated FK columns.

•	Assigning User-Defined Properties. You can define your own column properties, and then assign property values to selected columns. These properties are external to the database and exist only within the scope of the data model.

Related Topics

  Using the Column Editor

  Summary of Column Property Editors


Summary of Column Property Editors

Column Property	Values Defined In
Datatype Null Option	Target Server Editor
Column Name Domain	Attribute Editor
All	Column Editor
All (inherited from the Domain)	Domain Dictionary Editor


Using the Column Editor

Using the Column Editor, you can view and update the properties for each column in each table in the physical schema and access editors to create default values, validation rules, user-defined properties, and domains. When DM (Dimensional Modeling) notation is selected for your physical model, you can also specify a data warehouse source for each column. Properties that can be assigned to a physical table column include the column name, datatype, null option, average width, percent null, validation rule, default value, data warehouse source and column property migration rules. You can also assign user-defined properties and column display properties for target servers which provide native application development tools and for PowerBuilder or Visual Basic applications.

When you choose Column on the Edit menu or Column Editor on the Table shortcut menu, ERwin displays the Column Editor.

The purpose of each control in the Column Editor is explained below:

•	Table. Displays the name of the table that contains the column(s) to which you can assign properties. To view the columns in another table, select a different table name from the list.

•	 (Table). Click this button to open the Table Editor.

•	Column. Displays the names of all columns in the current table.

•	. Moves the selected column up one position in the physical column order.

•	. Moves the selected column down one position in the physical column order.

•	New. Click this button to open the New Column dialog and add a new column to the table.

•	Rename. Click this button to open the Rename Column dialog and edit the name of the selected column.

•	Delete. Deletes the selected column from the table.

•	Migrate. Click this button to open the Migrate Column Properties dialog and change the properties that migrate with FK columns.

•	Reset. Click this button to open the Reset Column Properties dialog and reset one or more properties to the default setting specified by the associated domain.

•	DB Sync. Click this button to start the Complete Compare task, so you can synchronize the columns defined in your data model with the information stored on the server. See Using the DB Sync Button for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Often, ERwin displays only the first few tabs that are available. You can scroll through the available tabs using the spin control [image] to locate the tab you want.

The Column Editor includes the following tabs:

•	General. Manage the domain, primary key, and logical or physical model display properties for the selected column.

•	<Database>. Manage the datatype, null option, validation (constraint) rule, and default value for the selected column. You can also enter column volumetrics information. The name of this tab changes dynamically depending on the target server selected. For example, if you are working with a SQL Server target server, the tab reads “SQL Server”.

•	Comment. Type a definition or comment for the selected column.

•	UDP. Specify a user-defined property value for the selected column.

•	Data Source. Specify the data warehouse source for the selected column.

•	Index. Manage index membership for the selected column.

•	Visual Basic. Specify the edit control features for Visual Basic.

•	PowerBuilder. Specify the edit control features for PowerBuilder.

Note:	When you select a different column in the Column list, any property changes you made to the previously selected (highlighted) column can still be canceled by clicking the Cancel button. However, if you switch to another table, the column property changes are implemented in the model and pressing the Cancel button does not cancel the earlier changes.

Related Topics

  To add a column to a table

  To change the properties of a column

  To rename a column

  To delete a column


To add a column to a table

1.	Right-click on the table to which you want to add a new column, then choose Column Editor on the shortcut menu.

2.	Click New.

3.	Type a name for the column in the Column text box.

4.	Click OK to close the New Column dialog.

5.	Click OK to close the Column Editor.

Note:	If you want the corresponding attribute to have a different name than the column name, you can type a name for the attribute in the Attribute text box.


To change the properties of a column

1.	Right-click on the table that contains the column, then choose Column Editor on the shortcut menu.

2.	Select the column you want to modify from the Column list.

3.	Choose one or more of the following options:

•	To change the order in which the column appears in the table, click the [image] or [image] button one or more times to move the column to a new position in the table.

•	To specify a datatype, average width, null option, percent null, default value, and validation rules, click the <Database> tab. More>

•	To specify column display properties, click the …Access, …AS/400, …PROGRESS, or …Teradata tab.

•	To attach a domain, specify a primary key column or include the column in an index click the General tab. More>

•	To type a definition for the column, click the Comment tab. More>

•	To specify a UDP property value for a column or to define a column property, click the UDP tab. More>>

•	To specify a data warehouse source for a column, click the Data Source tab. More>>

•	To specify client-side display properties, click the <Client> or <…Client> tab.

4.	Click OK.


To rename a column

1.	Right-click on the table that contains the column, then choose Column Editor on the shortcut menu.

2.	Select the column you want to modify from the Column.

3.	Click Rename.

4.	Type a new name for the column in the Column text box.

5.	Click OK to close the Rename Column dialog.

6.	Click OK.

Note:	If you want to change the name of the corresponding attribute, switch to the Logical Model, then choose Attribute Editor on the Edit menu.


To delete a column

1.	Right-click on the table that contains the column, then choose Column Editor on the shortcut menu.

2.	Select the column you want to delete in the Column list.

3.	Click Delete.

4.	Click OK.

Tip:	You can also delete a column in the diagram window by clicking [image], selecting the column name you want to delete, and pressing the DELETE key.


Attaching a Domain to a Column

You can use the controls on the General tab of the Column Editor to view and update the general information about the column including the:

•	Assigned Domain.

•	Inclusion of the column in the physical model only or in the physical and logical model.

•	Primary key assignments.

The purpose of each control on the General tab is explained below:

•	Alphabetically. Click this button to sort the domains in alphabetical order.

•	Hierarchically. Click this button to sort the domains in hierarchical order.

•	Domain. Select a domain from the list to attach it to the selected column. A domain is a named set of column properties that can be attached to one or more columns to assign specific property values, such as datatype, display mask, or validation rule. Double-click on the column name to open the Domain Dictionary Editor.

•	 (Domain). Click this button to open the Domain Dictionary Editor (physical model). See Using the Domain Dictionary Editor in a Physical Model for more information.

•	Primary Key. Select this check box if you want the selected column to be included in the primary key. Clear this check box if you want the column to be a non-key column.

•	Physical Only. Select this check box if you want the selected column to appear in the physical model only. Clear this check box if you want the selected column to have a corresponding attribute in the logical model.

Related Topics

  Using the Column Editor

  To assign a domain to a column


To assign a domain to a column

1.	Right-click on the table that contains the column, then choose Column Editor on the shortcut menu.

2.	Select the column you want to modify in the Column list.

3.	Click the General tab.

4.	Choose one of the following options:

•	To assign a domain to a column, click on the domain name in the Domain list.

•	To change the domain that is assigned to the column, click on the name of another domain in the Domain list.

•	To remove the domain association from the column, click on the <default> domain in the Domain list.

•	To define a new domain, click the Domain [image] button to open the Domain Dictionary Editor.

5.	Click OK.

Note:	If you do not want the selected domain to be associated with the corresponding attribute in the logical model, click the Domain [image] button, then select the Physical Only check box in the General tab. You can then assign a different, logical-only domain to the attribute in the Attribute Editor.


Setting Database-Specific Column Properties

You can use the controls in the <Database> tab of the Column Editor to view and update database-specific information about the column including datatype, null option, default value, or validation rule.

The purpose of each control in the <Database> tab is explained below:

•	Attribute. Displays the corresponding attribute name in the logical model.

•	<Database> Datatype. Displays the datatype of the selected column. Select a datatype from the list to change the datatype for the selected column. If the selected datatype requires a value for precision, scale, or both, type the value inside the datatype parentheses. For example, you can select the DECIMAL() datatype and specify a scale of 10 and a precision of 2 inside the parentheses, to assign the datatype DECIMAL(10,2) to the selected column.

•	Null Option. Select the options that apply. Depending on the database selected, ERwin displays one or more of the following options:

•	NOT NULL. Click this button to specify the NOT NULL clause for the selected column.

•	NULL. Click this button to specify the NULL clause for the selected column.

•	IDENTITY. Click this button to specify an IDENTITY clause for the selected column.

•	WITH NULL. Click this button to specify the WITH NULL clause for the selected column.

•	NOT NULL WITH DEFAULT. Click this button to specify the NOT NULL WITH DEFAULT clause for the selected column.

•	Alloc. Type a value in characters that defines the space you want to allocate for the column in each row. The control is only displayed when the selected datatype is VARCHAR() or VARGRAPHIC(). (AS/400 only)

•	Allow Zero Length. Select this check box if you want to be able to store a zero-length string in this column. Clear the check box to prohibit zero-length strings in this column (Access only).

•	Average Width. Type an estimated average width for the column if the option is available (not dimmed). For example, if a variable width ADDRESS column is assigned a width of 50 characters, you can still type 20 as the average character width of the column. You can later use the Volumetrics Editor to calculate table and database size estimates based on these and other values.

•	Percent NULL. Type the estimated percentage of nulls used for that column if the option is available (not dimmed). For example, you can estimate a variable width ADDRESS 2 column assigned a width of 50 characters, to be NULL about 30 percent of the time. Use whole numbers. You can later use the Volumetrics Editor to calculate table and database size estimates based on these and other values.

•	Case Sensitive. Select this check box if you want the DBMS to consider the case of the values stored in database fields for the selected column during processing. If you clear this check box, the case of the characters in a value is ignored. For example, “table”, “TABLE”, and “Table” are treated as different values when Case Sensitive is selected; when it is cleared, the values are considered the same. This check box is only displayed when you select the CHAR() or CHARACTER() datatype. (PROGRESS and Teradata only)

•	Decimals. Type the number of decimal places to display for the values in the selected column. If you do not type a number, the Decimals value is set to zero. This text box is only displayed when you select the DECIMAL, DECIMAL(), or DECIMAL(,) datatype. (PROGRESS only)

•	For. Select the character string column subtype option (SBCS, MIXED, or BIT) from the list. This control is only displayed when the selected datatype is CHAR, CHAR(), CHARACTER, CHARACTER(), VARCHAR(), or LONG VARCHAR().(DB2/MVS and DB2/2 only)

•	IN <blobspace>. Type the name of the INFORMIX blobspace in which you want to store the current column.  If you leave the text box blank, data in the current column is stored with the rest of the table. ERwin displays the IN <blobspace> field when a text or byte datatype is selected. (INFORMIX only)

•	Type. Select a sub-datatype. The sub-datatype options depend on the datatype selected. This control is only displayed when the selected datatype is CHAR, CHAR(), CHARACTER, CHARACTER(), GRAPHIC, GRAPHIC(), VARCHAR(), or VARGRAPHIC(). (AS/400 only) See Summary of AS/400 Sub-Datatype Options for more information on the options available for each sub-datatype.

•	Valid. Displays the name of the validation rule attached to the selected column. The template code for the selected validation rule appears below this list. Select a different validation rule from the list to apply to the selected column. The validation rules displayed in the list can be created, modified, or deleted using the Validation Rule Editor.

•	 (Valid). Click this button to open the Validation Rule Editor. See Using the Validation Rule Editor for more information.

•	Default. Displays the name of the default rule attached to the selected column. The default value for the selected default rule appears below this list. Select a different default rule from the list to apply to the selected column. The default rules displayed in the list can be created, modified, or deleted using the Default Editor.

•	 (Default). Click this button to open the Default Editor. See Using the <Database> Default/Initial Editor for more information.

In addition to these standard controls, ERwin also provides additional datatype, column storage, and display property support for some servers, including Access, AS/400, PROGRESS, and Teradata databases.

Note:	When forward engineering, the Generate Schema Using ODBC SQL option does not support the Decimals feature in the generated schema. Use the PROGRESS 4GL option if you want to include this information in the physical schema.

Related Topics

  Using the Column Editor

  To change the properties of a column

  To assign default or validation constraints to a column

  Access Column Properties

  AS/400 Column Properties

  PROGRESS Column Properties

  Teradata Column Properties

  Specifying Column UDP Values


To assign default or validation constraints to a column

1.	Right-click on the table that contains the column, then choose Column Editor on the shortcut menu.

2.	Select the column you want to modify in the Column list.

3.	Choose one of the following options:

•	To assign a default value, select a named default from the Default list.

•	To define a new Default Value to assign to the column, click the [image] (Default) button to open the Default Editor.

•	To assign a validation rule, select a named validation rule from the Valid list.

•	To define a new validation rule to assign to the column, click the [image] (Valid) button to open the Validation Rule Editor.

•	To remove an assigned default value or validation rule, select the top (— — —) dashed entry in the list.

4.	Click OK.


Access Column Properties

Click the …Access tab of the Column Editor, Domain Dictionary Editor, or View Editor to specify how columns are presented in an Access application.

The purpose of each control in the …Access tab of the Column Editor is explained below:

•	Caption. Type a name that identifies the column values in Access applications. By default, ERwin automatically inserts the column name with a colon appended (e.g., “customer_name:”).

•	Format. Shows the display format for the selected column, if assigned. Select a display format name from the format list to assign a display format to the column. The display format controls how data is displayed in Access applications. For example, mm/dd/yyyy is a date format that displays a date value as 09/12/1999.

•	. (Format). Click this button to open the Display Format Editor. See Using the Display Format Editor for more information.

•	Mask. Type a symbol string to control how data is entered and displayed in Access applications. For example, the input mask (###) ###-#### lets you type just the digits (and only the digits) for a standard North American telephone number; the parentheses, space, and hyphen are entered automatically.

Related Topics

  Using the Column Editor


AS/400 Column Properties

Click the …AS/400 tab of the Column Editor, Domain Dictionary Editor, or View Editor to specify how columns are presented in an AS/400 application.

The purpose of each column display control on the …AS/400 tab is explained below:

•	Label. Type the name of a label that is displayed opposite the column value in AS/400 applications (e.g., “customer_name:”). By default, ERwin automatically inserts the column name with a colon appended.

•	Heading. Type the name of a heading for column values when they are displayed as a table  (e.g., “customer_name”). By default, ERwin automatically inserts the column name in this text box.

•	System Name. Type a name to override the alias name that AS/400 automatically assigns to each column. Leave the box blank if you want the AS/400 database to automatically truncate the column name to show only the first 10 characters.

Related Topics

  Using the Column Editor


Summary of AS/400 Sub-Datatype Options

Datatype Selected	Sub-Datatype Options
CHAR, CHAR(), CHARACTER, CHARACTER(), VARCHAR	CCSID <integer> FOR BIT DATA FOR MIXED DATA FOR SBCS DATA
GRAPHIC, GRAPHIC(), VARGRAPHIC	CCSID <integer>
Related Topics

  Using the Column Editor

  Setting Database-Specific Column Properties


PROGRESS Column Properties

When you click the …PROGRESS tab of the Column Editor or Domain Dictionary Editor you can specify how columns are presented in a PROGRESS 4GL application.

The purpose of each PROGRESS-specific column display control of the …Progress tab is explained below:

•	Format. Shows the display format for the selected column, if assigned.  The display format controls how data is displayed in PROGRESS applications (e.g., dd-mmm-yy displays a date value as 12-May-99). For CHAR(n) datatypes, if you do not specify a format, ERwin automatically generates the format X(n), where n is the number of characters defined in the datatype. To assign a display format to the column, select a display format name from the list.

•	. (Format). Click this button to open the Display Format Editor. See Using the Display Format Editor for more information.

•	Label. Type a name (up to 48 characters) that identifies the column values in PROGRESS applications. By default, ERwin automatically inserts the column name with a colon appended (e.g., “customer_name:”).

•	Col Label. Type a name (up to 48 characters) that identifies the column values in a tabular layout in a PROGRESS application. By default, ERwin automatically inserts the column name in this text box (e.g., “customer_name”). If this control is left blank, PROGRESS uses the name in the “Label” text box described above.

•	Extent. Type the number of elements in an array field. An array field is a field that can contain multiple values. For example, a MONTH field that is not an array field can contain one of 12 possible values (January, February, etc.). However, the MONTH extent can contain all twelve month name values. If you do not type a number, the field is not treated as an array field.

•	Order #. Type a number that identifies the display order of a field relative to other fields in a PROGRESS application. PROGRESS maintains a field selection table that determines the order in which the fields are displayed. The number you type determines where the selected field appears in the field selection table. By default, PROGRESS assigns numbers (in increments of 10) to the fields in the order you type them. You can assign any unused number to a field to control the order in which the field is displayed relative to the other fields in your application.

•	View As. Type a PROGRESS “View As” phrase that defines the type of widget used to display the column data in a PROGRESS application. The supported widget types are: FILL-IN, EDITOR, RADIO-SET, SELECTION-LIST, and TEXT. The datatype of the column determines the types of widget you can choose. See your PROGRESS documentation for more information about “View As” phrases.

•	Help Text. Type help information for the field in a PROGRESS application. PROGRESS displays this help information on the help information line in a PROGRESS application when a user is prompted to type a field value.

Related Topics

  Using the Column Editor


Teradata Column Properties

Click the …Teradata tab of the Column Editor or Domain Dictionary Editor to specify how columns are presented in a Teradata application.

The purpose of each Teradata-specific control on the …Teradata tab is explained below:

•	COMPRESS. Select this option to reduce the amount of physical storage space occupied by a column that contains a large number of nulls, zeros, blanks, or the specified constant. Type the constant you want to compress in the text box opposite the COMPRESS check box. You cannot compress columns that are components of a primary index.

•	Format. Shows the display format for the selected column, if assigned. To assign a display format to the column, select a display format name from the Format list. The display format controls how data is displayed in Teradata applications (e.g., DDbMMMbYYYY is a date format that displays the date value December 12, 1999 as “12 DEC 1999”).

•	. (Format). Click this button to open the Display Format Editor. See Using the Display Format Editor for more information.

•	Title. Type a name (up to 60 characters) that identifies the column values in Teradata applications. By default, ERwin uses the column name with a colon appended (e.g., “customer_name:”).

•	CASE. Select this check box to specify whether column values should be stored exactly as entered or be automatically converted to uppercase characters. This check box is only displayed if the datatype for the selected column is CHAR, VARCHAR(n), or LONG VARCHAR. Choose:

•	CASESPECIFIC to store the value for a column exactly as it is entered.

•	UPPERCASE to store the value for a column in UPPERCASE.

Related Topics

  Using the Column Editor


Specifying a Column Comment

You can use the controls in the Comment tab of the Column Editor to view and update the column definition. You can generated this definition as a column comment if this feature is supported by your target server.

The purpose of each control in the Comment tab is explained below:

•	Comment. Type or edit the definition for the selected column. If your target server supports comments, ERwin optionally generates the definition as a comment in the schema DDL script.

•	Update Attribute Definition To Match. Select this option if you want the column definition to also appear as the definition for a corresponding attribute in the logical model. Clear the option if you want the definitions for corresponding columns and attributes to contain different text.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Using the Column Editor

  To specify a column comment


To specify a column comment

1.	Right-click on the table that contains the column, then choose Column Editor on the shortcut menu.

2.	Select the column you want to modify in the Column list.

3.	Click the Comment tab.

4.	Perform one or more of the following actions:

•	To create a new comment, type a definition in the Comment text box.

•	To edit an existing comment, use the standard keyboard editing keys to add or delete text.

•	To edit the comment in a larger window, click [image].

5.	If you want the corresponding attribute definition to match the column comment, select the Update Attribute Definition To Match check box.

6.	Click OK.


Specifying Column UDP Values

After you create UDPs for a column in the UDP Editor, you can easily specify property values for the column in the UDP tab of the Column Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP to select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Column Editor

  To specify column UDP values

  Creating User-Defined Properties


To specify column UDP values

1.	Define a column user-defined property (UDP). More>>

2.	Choose Column on the Edit menu.

3.	Click on the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Specifying Data Warehouse Sources for a Column

You can use the controls in the Data Source tab of the Column Editor to view and update data warehouse source assignments. You can use the Data Warehouse Source Editor to define data source names and locations or import source meta data (table and column names) from an existing database, script file, ER1 model, ModelMart diagram, or comma delimited file. The Data Source tab is only available when you select DM (Dimensional Modeling) notation for your physical model.

The purpose of each control in the Data Source tab is explained below:

•	Data Sources. Lists all data warehouse sources attached to the selected column.

•	 (Data Sources). Click this button to open the Data Warehouse Source Selector dialog.

•	Transform Comment. Type a comment describing how the source is integrated into the data warehouse.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Using the Column Editor

  To specify a data warehouse source

  To remove a data warehouse source


To specify a data warehouse source

1.	Choose Column on the Edit menu.

2.	Click on the Data Source tab.

3.	Click the [image] (Data Sources) button to open the Data Warehouse Source Selector dialog.

4.	Select one or more source columns from the Available Sources list by double-clicking on the source column.

5.	Click OK to close the Data Warehouse Source Selector dialog and to attach all source columns in the Selected Data Sources list to the selected column.

6.	Type a description of the data warehouse source in the Transform Comment text box.

7.	Click OK.


To remove a data warehouse source

1.	Choose Column on the Edit menu.

2.	Click on the Data Source tab.

3.	Click the [image] (Data Sources) button to open the Data Warehouse Source Selector dialog.

4.	Remove one or more source columns from the Selected Data Sources list by double-clicking on the source columns.

5.	Click OK to close the Data Warehouse Source Selector dialog and to attach only the source columns in the Selected Data Sources list to the selected column.

6.	Type a description of the data warehouse source in the Transform Comment text box.

7.	Click OK.


Assigning Index Membership

You can use the controls in the Index tab of the Column Editor to view and update index membership.

Each of the controls in the Index tab are described below:

•	Index Membership. Lists all indexes attached to the current table. Selected items in this list show the primary key, alternate key, foreign key, and inversion entry indexes in which the selected column is a member. Select the check box next to an index name to assign the selected column to that index. Clear the check box next to an index name to remove the column from the index. Changing primary key index assignments has additional effects:

•	If you add the column to the primary key index, ERwin moves the column to the key area of the table.

•	If you remove the column from the primary key index, ERwin moves the column to the non-key area of the table.

•	. (Index Membership). Click this button to open the Index Editor. See Using the Index Editor for more information.

•	Show FK Indexes. Select this option to display foreign key indexes in the Index Membership list. Clear the option to hide foreign key indexes.

Related Topics

  Using the Column Editor

  To add a column to an index

  To remove a column from an index

  Foreign Key Migration


To add a column to an index

1.	Right-click on the table that contains the column, then choose Column Editor on the shortcut menu.

2.	Select the column you want to modify in the Column list.

3.	Click the Index tab.

4.	Select the check box next to an index name in the Index Membership list to include the column as a member of that index.

5.	Click OK.


To remove a column from an index

1.	Right-click on the table that contains the column, then choose Column Editor on the shortcut menu.

2.	Select the column you want to modify in the Column list.

3.	Click the Index tab.

4.	Clear the check box next to an index name in the Index Membership list. The column is no longer a member of that index.

5.	Click OK.


Migrating Column Properties

When you create a relationship, ERwin automatically migrates the primary key columns of the parent table into the child table as foreign key columns. By default, all properties of the primary key are migrated to the foreign key in the child table. You can also choose which column properties migrate with the foreign key for each relationship in your model.

When you click the Migrate button in the Column Editor, ERwin opens the Migrate Column Properties dialog. ERwin lists the column properties that you can migrate to associated foreign keys on two tabs:

•	<Database>.  Choose the database-specific column properties that you want to migrate. The options available in the <Database> tab include server-specific properties.

•	<Client>.  Choose the Visual Basic column properties or PowerBuilder extended attributes that you want to migrate to foreign key columns. See Migrating PB Extended Attributes or Migrating VB Column Properties for more information.

After you select the properties that you want to migrate for the columns in a table and click OK, and click OK again to close the Column Editor, ERwin migrates the selected properties throughout the model, from each primary key column to each related foreign key column.

The purpose of each control in the <Database> tab is described below:

•	Domain. Migrate attached domains to an FK column.

•	Col Name. Migrate column names to an FK column.

•	Datatype. Migrate column datatypes to an FK column.

•	Average Width. Migrate the column average width estimates to an FK column.

•	Null Option. Migrate column null options to an FK column.

•	Percent NULL. Migrate the column percent null estimates to an FK column.

•	Valid Rule. Migrate validation rules to an FK column.

•	Default. Migrate column default values to an FK column.

•	Comment. Migrate column definitions to an FK column.

•	Physical Only. Migrate the physical model only property values to an FK column.

•	UDP. Migrate column user-defined property (UDP) values to an FK column.

•	Data Sources. Migrate the column data source values to an FK column.

•	Source Comment. Migrate the data source Transform Comment for the column to an FK column.

•	Select All. Click this button to select all check boxes and migrate all column properties in the primary key column to the foreign key column.

•	Clear All. Click this button to clear all check boxes and prevent all properties from migrating from the PK column to the FK column.

•	OK. Click this button to close the dialog. When you close the Column Editor, ERwin automatically cascades all the appropriate column property information to foreign keys in child tables throughout the diagram.

•	Cancel. Click this button to close the dialog and cancel your changes.

The following options are also displayed on this dialog, depending on the target server selected:

•	Allocate. Migrate the space allocation property for VARCHAR() or VARGRAPHIC() datatypes (AS/400 only).

•	Allow Zero. Migrate the allow-zero-length property assigned to a column (Access only).

•	Case. Migrate the case sensitive property assigned to a column (PROGRESS and Teradata only).

•	For. Migrate the FOR <subtype data> property assigned to a column. This control is only displayed when the selected datatype is CHAR, CHAR(), CHARACTER, CHARACTER(), VARCHAR(), or LONG VARCHAR().(DB2/MVS and DB2/2 only)

•	IN. Migrate the assigned blobspace from a PK to an FK column (INFORMIX only).

•	Char Type. Migrate the sub-datatype property for CHAR, CHAR(), CHARACTER, CHARACTER(), GRAPHIC, GRAPHIC(), VARCHAR(), or VARGRAPHIC() datatypes (AS/400 only).

Additional options on this dialog support server-specific column properties. For information on these properties, click on your target server below:

•	Access

•	AS/400

•	PROGRESS

•	Teradata

Note:	The Migrate Column Property options should be used with care because the migrated properties override any previous column property settings assigned to the foreign keys, including properties assigned from the default setting in the Target Server Editor, an associated domain, or a specific override for a particular column.

Related Topics

  To migrate column properties to foreign key columns

  Foreign Key Migration


To migrate column properties to foreign key columns

1.	Right-click on the table that contains the primary key columns, then choose Column Editor on the shortcut menu.

2.	Click the Migrate button.

3.	Choose one or more of the following options:

•	To migrate the domain, select the Domain option.

•	To indicate which properties you want to migrate from the selected primary key column to the related foreign key columns in child tables, click one or more of the column property check boxes.

•	To migrate all properties, click the Select All button.

•	To clear all properties, click the Clear All button.

4.	Click OK to close the Migrate Column Properties dialog.

5.	Click OK again. ERwin migrates the selected column properties from all primary key columns to all foreign key columns.


Using the Display Format Editor

If the target server is an Access, PROGRESS, or Teradata target server, you can create a server display format and associate it with a column.

When you click the...<target server> tab in the Column Editor, you can click the Open Editor button [image] to open the Display Format Editor. You can then specify how column data is presented in a form or report. The most common examples of display formats are those used to show numbers as currency values or to show date values in a specific month-day-year format.

The purpose of each control in the Display Format Editor is described below:

•	Format Name. Lists the existing display formats (server and client) in your ERwin model. Click on a display format to select it.

•	Type. Lists the platform on which the format is valid. Valid types include: Client, Server, and Client/Server.

•	Sort By Type. Select this check box to sort the list in the Format Name list according to Type. Clear this check box to sort the list alphabetically by format name.

•	New. Click this button to open the New Format dialog and add a new format to the model.

•	Rename. Click this button to open the Rename Format dialog and edit the name of the selected format.

•	Delete. Deletes the selected format from the model.

•	Server Value. Type a display format value that is valid for the selected target server.

•	Client Value. Type a display format value that is valid for the selected client.

•	Client Type. Select a client datatype for the current display format. Options include String, Number, Date, Time, and Datetime.

•	PB Sync. Click this button to log on to the target server and synchronize PowerBuilder display format information in ERwin with the target server.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	The display format must be expressed in the correct syntax for the target server and client. See your server or client software documentation for more information on how to specify a display format.

Related Topics

  To create or modify a server display format

  Access Column Properties

  PROGRESS Column Properties

  Teradata Column Properties

  Using the PB Display Format Editor

  Using the VB Display Format Editor


To create or modify a server display format

1.	Right-click on the table that contains the column, then choose Column Editor on the shortcut menu.

2.	Click the …Access, …PROGRESS, or …Teradata tab.

3.	Click the Format [image] button.

4.	Choose one of the following actions:

•	To modify an existing display format, select the display format and change the server or client display properties.  Refer to your client software or server documentation for syntax information.

•	To create a new display format, click the New button and type the name of the new display format in the Name text box.

•	To delete a display format, select the display format and click the Delete button.

5.	Click OK.

Note:	Saved display formats are only available for Access, PROGRESS, and Teradata databases.


Resetting Column Properties to the Domain Defaults

If you attach a domain to a column and then use the controls in the Column Editor or View Column Editor to override specific domain settings, you can easily reset the column properties to the defaults provided by the domain. ERwin provides a high level of precision when resetting column properties—you can reset only a single property, a group of properties, or all properties for the selected column or table.

When you click the Reset button in the Column Editor or View Column Editor, ERwin displays the Reset Column Property dialog.

The purpose of each control in the Remove overridden properties for group box is explained below:

•	Only column <column name>. Click this button to reset the properties of the column selected in the Column Editor or View Column Editor only.

•	All columns in the <table name> table. Click this button to reset the properties of all columns in the selected table.

The controls in the <Database> tab of the Reset Column Properties dialog are specific to the target server and client software selected.

The purpose of each control on the <Database> tab is explained below:

•	Col Name. Select this check box to reset the selected column names to those of the corresponding attribute in the logical model. ERwin automatically replaces any spaces in the logical names with underscores.

•	Datatype. Select this option if you want to reset the datatype of the selected columns to the default specified in the Target Server dialog.

•	Null Option. Select this option if you want to reset null option of the selected columns to the default specified in the Target Server dialog.

•	Valid Rule. Select this option if you want to detach all validation rules from the selected columns.

•	Default. Select this option if you want to detach all default values from the selected columns.

•	Comment. Select this option if you want to reset the comment for the selected columns to the definition for the corresponding attribute in the logical model.

•	Physical Only. Select this option if you want to reset the physical model only property to the default (cleared).

•	UDP. Select this option if you want to reset the user-defined properties for the selected column to the domain UDP inherited-by-column value.

The following options are also displayed on this dialog, depending on the target server selected:

•	Allocate. Select this option to reset the space allocation property for VARCHAR() or VARGRAPHIC() datatypes to the default (AS/400 only).

•	Allow Zero. Select this option to reset the allow-zero-length property assigned to a column to the default (Access only).

•	Case. Select this option to reset the case sensitive property assigned to a column to the default (PROGRESS and Teradata only).

•	For. Select this option to reset the FOR <subtype data> property assigned to a column to the default. This control is only displayed when the selected datatype is CHAR, CHAR(), CHARACTER, CHARACTER(), VARCHAR(), or LONG VARCHAR() (DB2/MVS and DB2/2 only).

•	IN. Select this option to detach all blobspaces from the selected columns (INFORMIX only).

•	Char Type. Select this option to reset the sub-datatype property for CHAR, CHAR(), CHARACTER, CHARACTER(), GRAPHIC, GRAPHIC(), VARCHAR(), or VARGRAPHIC() datatypes to the default (AS/400 only).

Additional options on this dialog support server-specific column properties. For information on these properties, click on your target server below:

•	Access

•	AS/400

•	PROGRESS

•	Teradata

You can use the controls on the <Client> tab to specify which of the PowerBuilder or Visual Basic extended attributes you want to reset to a foreign key. See Resetting PB Extended Attributes to Domain Defaults for more information on the controls on the PowerBuilder tab.  See Resetting VB Column Properties for more information on controls on the Visual Basic tab.

The purpose of the remaining controls on this dialog are explained below:

•	Select All. Selects all of the check boxes in the dialog.

•	Clear All. Clears all of the check boxes in the dialog.

•	OK. Click this button to close the dialog.

•	Cancel. Click this button to close the dialog and cancel your changes.

Related Topics

  To reset column properties to the domain defaults


To reset column properties to the domain defaults

1.	Right-click on the table that contains the column(s) you want to reset to the domain defaults, then choose Column Editor on the shortcut menu.

2.	To reset the properties for a single column, select the column from the Column list.

3.	Click the Reset button.

4.	Choose one of the following actions:

•	To reset all column properties in the table, click the All Columns of table <table name> button.

•	To reset all column properties for the current column, click the Only column <column name> button.

5.	Choose the properties you want to reset in the <Database> and <Client> tabs:

•	To clear all property selections, click the Clear All button.

•	To reset a property to the default value assigned by the domain, select the property check box.

•	To reset all properties to the default values assigned by the domain, click the Select All button.

6.	Click OK.


Resetting Domain Properties to the Parent Domain

If you use the controls in the Domain Dictionary Editor to override specific domain settings inherited from the parent domain, you can easily reset the domain properties to the defaults provided by the parent domain. ERwin provides a high level of precision when resetting domain properties—you can reset only a single property, a group of properties, or all properties for the selected domain.

When you click the Reset button in the Domain Dictionary Editor, ERwin displays the Reset Domain Properties dialog.

The controls in the Reset Column Domain Properties dialog are specific to the target server and client software selected. Standard controls available for most target servers include:

The purpose of each control on the <Database> tab is explained below:

•	Col Name. Select this check box to reset the column name of the domain to that of the parent domain.

•	Datatype. Select this option to reset the domain datatype to the datatype of the parent domain.

•	Null Option. Select this option to reset the domain null option to the null option of the parent domain.

•	Valid Rule. Select this option to change the domain validation rule to the validation rule of the parent domain.

•	Default. Select this option to change the domain default value to default value of the parent domain.

•	Comment. Select this option to change the domain comment to the comment of the parent domain.

•	Physical Only. Select this option to change the Physical Only property of the domain to Physical Only property of the parent domain.

•	UDP. Select this option to reset the user-defined properties for the selected parent domain to its default value.

The following options are also displayed on this dialog, depending on the target server selected:

•	Allocate. Select this option if you want to reset the space allocation property of the domain for VARCHAR() or VARGRAPHIC() datatypes to that of the parent domain. (AS/400 only).

•	Allow Zero. Select this option to reset the allow-zero-length property of the domain to allow-zero-length property of the parent domain. (Access only).

•	Case. Select this option if you want to reset the case sensitive property of the domain to the case sensitive property of the parent domain (PROGRESS and Teradata only).

•	For. Select this option to reset the FOR <subtype data> property of the domain to the FOR <subtype data> property of the parent domain. This control is only displayed when the selected datatype is CHAR, CHAR(), CHARACTER, CHARACTER(), VARCHAR(), or LONG VARCHAR() (DB2/MVS and DB2/2 only).

•	IN. Select this option to change the blobspace assignment of the domain to the blobspace property of the parent domain (INFORMIX only).

•	Char Type. Select this option to reset the sub-datatype property of the domain for CHAR, CHAR(), CHARACTER, CHARACTER(), GRAPHIC, GRAPHIC(), VARCHAR(), or VARGRAPHIC() datatypes to the sub-datatype property of the parent domain (AS/400 only).

Additional options on this dialog support server-specific domain properties. For information on these properties, click on your target server below:

•	Access

•	AS/400

•	PROGRESS

•	Teradata

You can use the controls on the <Client> tab to specify which of the PowerBuilder or Visual Basic extended attributes in the domain that you want to reset to those of the parent domain. See Resetting PB Extended Attributes to Domain Defaults for more information on the controls on the PowerBuilder tab.  See Resetting Visual Basic Column Properties for more information on controls on the Visual Basic tab.

The purpose of the remaining controls on this dialog are explained below:

•	Select All. Selects all of the check boxes in the dialog.

•	Clear All. Clears all of the check boxes in the dialog.

•	OK. Click this button to close the dialog.

•	Cancel. Click this button to close the dialog and cancel your changes.

Related Topics

  To reset domain properties to their default values


To reset domain properties to their default values

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Select the domain you want to modify in the Domain list.

4.	Click the Reset button.

5.	Select one or more of the options in the Reset Column Domain Property dialog to indicate which properties you want to reset to the default values inherited by the domain.

6.	Click OK to close the Reset Domain Property dialog.

7.	Click OK.


Specifying Constraints

Depending on the target database you have selected, ERwin supports the entry of constraint information in the form of column default or initial values and validation rules, and generation of these constraints in the schema.

♦	A default specifies a value for a column if no value is explicitly supplied when a record is inserted into the table. Each column can have a default value associated with it.

♦	An initial value specifies the value that you want to appear in a screen form for a client application (available for PROGRESS and client-side properties only).

♦	A validation rule specifies a fixed list of valid values for a particular column or uses an expression to define some form of data validation code for a column or table.

Validation rules and default column values are generated with the appropriate data definition statements for your target DBMS, either actively via connection to the system catalog or to a DDL script.

Note:	ERwin does not currently do any consistency checking between constraints and default values for a column.

Related Topics

  Target Server Constraint Terminology

  Using the <Database> Default/Initial Editor

  Using the Validation Rule Editor

  Using the Valid Value Editor


Target Server Constraint Terminology

The various target databases use different terminology to describe constraints as summarized in the following table. The options listed below appear in the <Database> Schema Generation Report Editor.

DBMS	Column-Level Constraints Terminology	Column Level Default Terminology	Table-Level Constraints Terminology
AS/400	N/A	DEFAULT Value	N/A
DB2/MVS	FIELDPROC/Check	N/A	VALIDPROC/Check
DB2/2	Column CHECK	DEFAULT Value	Table CHECK
INFORMIX	Column CHECK	DEFAULT Value	Table CHECK
Ingres/ OpenIngres	Integrity/Check	DEFAULT Value	Integrity/Check
Interbase	Column CHECK	DEFAULT Value	Table CHECK
ORACLE	Check Constraint	DEFAULT Value	Table CHECK
Progress	Validation	Initial Value	Validation
Red Brick	N/A	DEFAULT Value	N/A
Rdb	Column Check	DEFAULT Value	Table CHECK
SYBASE	Validation	Default	Table CHECK
SQLBase	N/A	N/A	N/A
SQL Server	Validation	Default	Table CHECK
Teradata	Column CHECK	DEFAULT Value	Table CHECK
WATCOM/ SQL Anywhere	Column CHECK	DEFAULT Value	Table CHECK
Note:	Not all target servers support constraints. For those that do not, ERwin provides constraint editors for these target databases, but does not generate SQL constraint statements for them.


Using the <Database> Default/Initial Editor

The <Database> Default/Initial Editor lets you create a server default value for a column. Frequently, the most common value stored in a column is assigned as the server default value for that column.

For example, in the MOVIE_RENTAL_RECORD table in the MOVIES diagram , the due_date column might be assigned the server default value Current Date +1. By assigning this server default value to the due_date column, all rentals are automatically due the next day.

When you click the [image] (Default) button on the Column Editor, ERwin displays the <Database> Default/Initial Editor.

The purpose of each control in the <Database> Default/Initial Editor is explained below:

♦	Default Name. Displays the existing server default values.

♦	Type. Indicates the type of default or initial value represented by the selected default name. Types include:

•	Client, which appears if an initial value is entered in the Client Value - <Client> Initial text box.

•	Server, which appears if a default value is entered in the Server Value - <Database> Default text box

•	Client/Server, which appears if a value is entered in both text boxes.

♦	Sort By Type. Select this check box if you want the Default Name list to be sorted by the value in the Type column in the following order: Client, Server, Client/Server. Clear this check box if you want the Default Name list to be sorted alphabetically by default name.

♦	New. Click this button to open the New Default dialog and add a default value.

♦	Rename. Click this button to open the Rename Default dialog and edit the name of the selected default value.

♦	Delete. Deletes the selected default value.

♦	Server Value - <Database> Default. Displays the server default value for the selected default name. Enter or edit the default value that you want to generate in the schema script.

♦	Client Value - <Client> Initial. Displays the client default value for the selected default name. Enter or edit the default value that you want to use in your client applications.

♦	OK. Closes the dialog and saves your changes.

♦	Cancel. Closes the dialog and cancels any changes.

After you create a server default value, you can assign it to one or more columns using the Column Editor. To attach a server default value, open the Column Editor, select the column to which you want to attach the server default value, and then select the server default value from the Default list. See Setting Database-Specific Column Properties for more information.

Note:	If the current target server is SQL Server version 6 or SYBASE System 10 or 11, the <Database> Default Editor displays the sp_bindefault and the DEFAULT option buttons (in addition to the controls discussed above) that let you define how ERwin generates the default value(s) attached to a column in the schema.

To create a separate statement that defines a default value and binds the statement to a column when the schema is generated, click the sp_bindefault option button.

To include a DEFAULT statement that defines the default value for a column in the CREATE TABLE statement, click the DEFAULT option button. See the Microsoft SQL Server or SYBASE documentation for more information.

Related Topics

  WITH DEFAULT Option Representation

  To create a default value

  To modify a default value

  To assign a default value to a column

  To delete a default value


WITH DEFAULT Option Representation

Several DBMSs, including AS/400, DB2/MVS, DB2/2, Ingres, and SQLBase support the NOT NULL WITH DEFAULT option. You can implement this option in the Column Editor, by selecting the System Generated default rule in the Default list.

When this option is applied to a column, the DBMS applies a system-generated default value to the column based on the column’s datatype. The user cannot specify the default value.

When you select a target DBMS that supports the WITH DEFAULT option, the System Generated default with a value of WITH DEFAULT can be attached to a column. If you switch to a DBMS that does not support the WITH DEFAULT option, ERwin automatically detaches the default from all columns to which it is attached and deletes the System Generated default.

Note:	ERwin uses the same technique to implement Ingres’s NULL WITH DEFAULT and NULL NOT DEFAULT options.

Related Topics

  Using the <Database> Default/Initial Editor

  Using the Column Editor


To create a default value
To create a default or initial value

1.	Click Default/Initial on the Server menu.

2.	Click the New button.

3.	Type the name for the default or initial value you want to create in the Name text box.

4.	Click OK.

5.	Choose one or more of the following options:

♦	Type a server default or initial value expression in the Server Value - <Database> Default text box. See your server documentation for information on the syntax you can use in a default or initial value expression.

♦	Type a client initial value expression in the Client Value - <Client> Default text box. See your Visual Basic or PowerBuilder documentation for information on the syntax you can use in a initial value expression.

6.	Click OK.


To modify a default value
To modify a default or initial value

1.	Click Default/Initial on the Server menu.

2.	Select the default or initial value you want to modify in the Default Name list box.

3.	Choose one or more of the following options:

♦	To change the name of the default or initial value, click Rename, update the contents of the Name text box, and click OK.

♦	To change the server default or initial value, click in the Server Value - <Database> Default text box and edit the value.

♦	To change the client initial value, click in the Client Value - <Client> Default text box and edit the value.

4.	Click OK.


To assign a default value to a column
To assign a default or initial value to a column

1.	Right-click on the table that contains the column, then click Column Editor on the shortcut menu.

2.	Select the column to which you want to attach a default or initial value in the Column list box.

3.	Click the <Database> tab.

4.	To create or modify a default or initial value, click [image] to open the <Database> Default/Initial Editor, enter the necessary information, and click OK to save your work and return to the Column Editor.

5.	Select a default or initial value name from the Default list box at the bottom of the tab.

6.	Click OK.


To delete a default value
To delete a default or initial value

1.	Click Default/Initial on the Server menu.

2.	Select the default or initial value you want to delete in the Default Name list box.

3.	Click Delete.

4.	Click OK.

Note:	If the default or initial value is assigned to a column, ERwin displays a confirmation dialog, which identifies the default or initial value and the column to which it is assigned. Click Yes to delete the value, or click No to cancel the delete request.


Using the Validation Rule Editor

The Validation Rule Editor lets you create a CHECK constraint called a validation rule. A validation rule is an expression that establishes the range of acceptable values that can be stored in a column and determines if an entered value is valid.

The Validation Rule Editor lets you define validation expressions at both the table and column levels to ensure that information entered into a column or table conforms to specific business rules.  A column-level validation rule is used to check the validity of data entered in a  column. For example, in the Movies model, the value entered in the movie_category column must be one of the specified valid values “Comedy”, “Drama”, “Mystery”, etc. A column-level validation rule is attached to a column using the Column Editor.

You can use a table level validation rule to check the values in two or more columns in a table simultaneously. For example, you could specify that rental_date <= due_date and attach this rule to a table using the Table Editor.

When you click Validation Rule on the Server menu, ERwin displays the Validation Rule Editor.

The purpose of each control in the Validation Rule Editor is explained below:

♦	Validation Name/Validation Rule. Lists the name of existing validation rules and the actual syntax that appears in the schema when the rule is generated.

♦	Sort By Type. Select this check box if you want the Validation Name/Validation Rule list to be sorted by the value in the Type column in the following order: Client, Server, Client/Server. Clear this check box if you want the Validation Name/Validation Rule list to be sorted alphabetically by validation name.

♦	Copy. Select this check box if you want to assign the valid value list associated with an existing validation rule to a new validation rule. To assign a valid value list, select the validation rule that you want to use as a source, select the Copy check box, then click New to create a new validation rule. ERwin copies the valid values from the source to the new validation rule and creates the appropriate server expression for the valid values you assigned.

♦	New. Click this button to open the New <Name> dialog and add a <Name>.

♦	Rename. Click this button to open the Rename <Name> dialog and edit the name of the selected <Name>.

♦	Delete. Deletes the selected <Name>.

The purpose of each control in the Validation Type group box is explained below:

♦	Client. Select this check box if you want the validation rule to apply to client-side applications. Clear the box if you do not want to specify a validation rule for client applications.

♦	Server. Select this check box if you want the validation rule to apply to the target server. Clear the box if you do not want to specify a validation rule for the target server.

The purpose of each remaining control in the Validation Rule Editor is explained below:

♦	Min. Type a value that you want to specify as the minimum value for a table column. ERwin generates the corresponding validation rule in the syntax of the selected server.

♦	Max. Type a value that you want to specify as the maximum value for a table column. ERwin generates the corresponding validation rule in the syntax of the selected server.

Note: 	To specify a range of values, type a value in both the Min and Max text boxes.

♦	Valid Value/Display Value. Lists the valid values and corresponding display values assigned to the selected validation rule.

♦	Set Expr. Generates a validation rule expression from the validation criteria specified in the Min and Max text boxes or the Valid Value Editor.

♦	Valid Value. Click this button to open the Valid Value Editor and specify a list of valid values for the validation rule. See Using the Valid Value Editor for more information.

♦	Quote. Select this check box to automatically enclose each value in a list of valid values in a single quotation mark. Clear this check box if you do not want ERwin to enclose each valid value in quotation marks. By default, when ERwin includes values in an expression, it does not enclose each value in quotation marks (e.g., C,D,M). In some cases, the syntax used by the target server requires that each value in an expression must be enclosed with single quotation marks (e.g., ‘C’ ‘D’ ‘M’).

♦	Not. Select this check box if you want to include the word “NOT” in the server expression, in order to invert it. Clear the check box if you do not want the server expression to include the word “NOT”. For example, if the server expression is BETWEEN 5 AND 10, and you select the NOT check box, ERwin changes the expression to NOT BETWEEN 5 AND 10.

♦	OK. Closes the dialog and saves your changes.

♦	Cancel. Closes the dialog and cancels any changes.

The Validation Rule Editor also includes two tabs:

♦	Server

♦	Client. The purpose of each control on the Client tab is explained below:

•	<Client Rule>. Type an expression in the correct syntax for the selected client in the text box to create a client-side validation expression.

Note:	If the client is PowerBuilder, this tab also includes the PB Error Msg, PB Type, and PB Sync controls. See Defining PB Validation Rules for more information.

After you create a validation rule, you can assign it to one or more columns using the Column Editor. See Setting Database-Specific Column Properties for more information.

You can also assign a validation rule to a table using the Validation tab on the Table Editor. See Attaching a Validation Rule to a Table for more information.

Related Topics

  To create a validation rule

  To assign an existing list of valid values to a validation rule

  To specify minimum or maximum values for a column

  To invert a validation expression

  To specify a server validation error message

  To modify a validation rule

  To delete a validation rule


Specifying A Validation Rule Expression For the Target Server

The Server tab of the Validation Rule Editor lets you specify the validation expression for your server.

The purpose of each control on the Server tab is explained below:

♦	<Server Rule>. Type an expression in the correct syntax for the selected server in the text box to create a server-side validation expression.

♦	Access Validation Text. This control is available for Microsoft Access only. Type the message you want displayed if a user attempts to enter an invalid value.

♦	Progress Error Msg. This control is available for PROGRESS only. Type the message you want displayed if a user attempts to enter an invalid value.

The following controls are specific to individual target servers, and affect how a constraint is implemented in the schema. See Specifying How Validation Rules are Generated for more information.

♦	VALIDPROC. This control is available for DB2/MVS 4 only. Check this option to implement table-level and/or column-level validation rules as VALIDPROC or FIELDPROC clauses in CREATE TABLE statements in the generated schema.

♦	INTEGRITY. This control is available for OpenIngres version 1.1 only.  Check this option to implement table-level and/or column-level validation rules as INTEGRITY clauses in CREATE TABLE statements in the generated schema.

♦	sp_bindrule. This control is available for SQL Server 6.x and SYBASE System 10 and 11 only. Check the appropriate option to implement column-level and/or table-level validation rules as separate SQL statements in the generated schema.  Check this option to implement table-level and/or column-level validation rules as sp_bindrule clauses in CREATE TABLE statements in the generated schema.

♦	CHECK Constraint. This control is available for DB2/MVS 4, OpenIngres version 1.1, SQL Server 6.x, and SYBASE System 10 and 11 only. Check this option to implement table-level and/or column-level validation rules as CHECK clauses in CREATE TABLE statements in the generated schema.

Related Topics

  Using the Validation Rule Editor


Specifying How Validation Rules are Generated

The Validation Rule Editor dialog for DB2/MVS version 4.0, OpenIngres version 1.1, SQL Server version 6.x, and SYBASE System 10 and 11 include controls that let you define how ERwin generates the validation rules associated with tables and columns.

You can implement validation rules as independent validation statements or as CHECK constraint clauses in the appropriate CREATE TABLE statements in the generated schema. During forward engineering, each validation rule for which you select the independent statement option (VALIDPROC, FIELDPROC, INTEGRITY, sp_bindrule) is generate in the schema as an independent statement. All other validation rules are implemented as a CHECK clause included in the CREATE TABLE or ALTER TABLE statement.

The following table shows the options for each target server that supports this feature.

DBMS	Independent Statement Option	CHECK Option
DB2/MVS version 4.0	VALIDPROC FIELDPROC	CHECK Constraint
OpenIngres version 1.1	INTEGRITY	CHECK Constraint
SQL Server version 6.x	sp_bindrule	CHECK Constraint
SYBASE system 10 or 11	sp_bindrule	CHECK Constraint
Related Topics

  Using the Validation Rule Editor


To create a validation rule

1.	Click Validation Rule on the Server menu.

2.	Click New.

3.	Type a name for the validation rule in the Name text box.

4.	Click OK.

5.	Select or clear the Client and Server check boxes to indicate whether the new rule is for a server or client application, or both.

6.	Choose one or more of the following options:

♦	Type the server expression in the <Database> Rule text box.

♦	Type the client expression in the <Client> Rule text box.

♦	To assign a set of valid values to the validation rule, click the Valid Value button. More>

♦	To define a limit or range of acceptable values, enter a value in the Min, Max, or both Min and Max text boxes. More>

7.	Optionally, choose one or more of the following options:

♦	To enclose each value in a valid value list in single quotation marks, check the Quote box .

♦	To invert the expression, check the Not box .

♦	To create a text message that displays if a user attempts to enter an invalid value in the associated column, type a text message in the Access Validation Text or Progress Error Msg text box.

8.	Click OK.


To assign an existing list of valid values to a validation rule

1.	Click Validation Rule on the Server menu.

2.	Select an existing validation rule in the Validation Name list box.

3.	Select the Copy check box.

4.	Click New.

5.	Type a name for the validation rule in the Name text box.

6.	Click OK.


To specify minimum or maximum values for a column

1.	Click Validation Rule on the Server menu.

2.	Click New.

3.	Type a name for the validation rule in the Name text box.

4.	Click OK.

5.	Choose one of the following options:

♦	To specify a minimum value, enter a value in the Min text box.

♦	To specify a maximum value, enter a value in the Max text box.

♦	To specify a range of valid values, enter a value in both the Min and Max text boxes.

6.	Click OK.


To invert a validation expression

1.	Click Validation Rule on the Server menu.

2.	Select a validation rule from the Validation Name list box or create a new validation rule.

3.	Select the Not check box to invert the expression.

4.	Click OK.


To specify a server validation error message

Note:	This option is available for Microsoft Access and PROGRESS target servers only.

1.	Click Validation Rule on the Server menu.

2.	Select a validation rule from the Validation Name list box or create a new validation rule.

3.	Type a text message in the Access Validation Text or Progress Error Msg text box. This message displays when the user attempts to enter an invalid value in the associated column.

4.	Click OK.


To modify a validation rule

1.	Click Validation Rule on the Server menu.

2.	Select the validation rule you want to modify in the Validation Name list box.

♦	To change the name of the validation rule, click Rename, then type a new name and click OK.

♦	To edit the server expression, click in the <Database> Rule text box and use the standard editing keys to modify the server expression.

♦	To change a minimum value, a maximum value, or a range, edit the values in the Min and Max boxes.

♦	To modify the list of valid values, click the Valid Value button. More>

3.	Click OK.


To delete a validation rule

1.	Click Validation Rule on the Server menu.

2.	Select the validation rule you want to delete in the Validation Name list box.

3.	Click Delete.

4.	Click OK.


Using the Valid Value Editor

The Valid Value Editor lets you create a fixed list of all acceptable values that can be stored in the column and assign it to a validation rule. For example, in the Movies model, if the MOVIE entity includes an attribute named movie-category, you can define a valid value list for the corresponding column that includes the following data values: New Release, Comedy, Horror, Musical, and Children.  If you define a valid value list and assign it to a column, only the specified values in the list can be stored in that column.

To open the Valid Value Editor, click the Valid Value button in the Validation Rule Editor. Once you have created a valid value list, you can choose Valid Value on the Server menu to edit the existing valid value list.

The purpose of each control in the Valid Value Editor is described below:

♦	Valid Rule. Lists the existing validation rules. Select the rule that contains the valid value list you want to view or modify.

♦	Data Value. Lists the valid values for the current validation rule.

♦	Display Value. Lists the display value for the corresponding valid value.

♦	Value Definition. Lists the definition for the corresponding valid value.

♦	Count. Specifies the number of valid values defined for the selected validation rule.

♦	Insert. Select this check box if you want to insert a new valid value into the list of values. When you click New and add a new valid value, the new value is placed directly above whichever value is selected in the Data Value list. Clear the check box if you want the new value to appear at the bottom of the list.

♦	New. Click this button to open the New Valid Value dialog and add a valid value.

♦	Rename. Click this button to open the Rename Valid Value dialog and edit the name of the selected valid value.

♦	Delete. Deletes the selected valid value.

♦	Display Value. Enter the value that you want to display to the user in an end-user application. For example, you could enter a list of valid state abbreviations, but display the corresponding state name in an end-user application.

♦	Definition. Enter a definition for the selected valid value.

♦	Sort. Sorts the valid values in ascending order (e.g., A-Z, 0-9).

♦	OK. Closes the dialog and saves your changes.

♦	Cancel. Closes the dialog and cancels any changes.

As you add new values, ERwin automatically appends them to the bottom of the list. You can also insert values into the list using the Insert check box, as described above, and rearrange valid values in the list using drag-and-drop.

Related Topics

  To create a valid value list

  To modify a valid value

  To insert a new valid value in the list

  To sort the valid value list

  To delete a valid value


To create a valid value list

1.	Click Validation Rule on the Server menu.

2.	Select a validation rule from the Validation Name list box or create a new validation rule.

3.	Click Valid Value.

4.	Click New.

5.	Enter the valid value in the Name text box.

6. 	Click OK.

7. 	Enter the corresponding display value and definition information for the new value in the Data Value and Value Definition text boxes.

8. 	Repeat Steps 4 through 7 for each value you want to include as a valid value for the validation rule.

9. 	Click OK to close the Valid Value Editor.

10. 	Click OK.

Note:	If there are no Validation Rules defined for the diagram, the Valid Value option on the Server menu is not available (dimmed). To create the first valid value list, you must use the Valid Value button in the Validation Rule Editor to open the Valid Value Editor.


To modify a valid value

1.	Click Valid Value on the Server menu or the Valid Value button in the Validation Rule Editor.

2.	Select the validation rule you want to modify in the Valid Rule list box.

3.	Select the value you want to change in the Data Value list box.

4.	Choose one or more of the following options:

♦	To change the name of a value, click Rename, type a new name in the Name text box, and click OK.

♦	To change the definition, edit the text in the Value Definition text box.

♦	To change the display value, edit the text in the Display Value text box.

5.	Click OK.


To insert a new valid value in the list

1.	Click Valid Value on the Server menu or the Valid Value button in the Validation Rule Editor.

2.	Select the validation rule you want to modify in the Valid Rule list box.

3.	Select the Insert check box.

4.	Select a value immediately below where you want to insert the new valid value in the Data Value list box.

5.	Click New.

6.	Type a valid value in the Name text box.

7.	Click OK.

8.	Click OK to close the Valid Value Editor.

Tip:	If you do not select the Insert check box, ERwin places new valid values at the end of the list. You can move any new or existing valid values up or down in the Data Value list box using drag and drop.


To sort the valid value list

1.	Open the Valid Value Editor.

2.	Click Sort. ERwin automatically sorts the valid value list in ascending order (e.g., A-Z, 0-9).

3.	Click OK.


To delete a valid value

1.	Click Valid Value on the Server menu or the Valid Value button in the Validation Rule Editor.

2.	Select the validation rule you want to modify in the Valid Rule list box.

3.	Select the value you want to delete in the Data Value list box.

4.	Click Delete.

5.	Click OK.


Using ERwin With Oracle Designer/2000

ERwin provides a powerful bidirectional link to the Oracle Designer/2000 repository. A Designer/2000 repository is a special dictionary database that is used to store system and data definition information for applications that access Oracle production databases. Using the Oracle API for updating the repository, ERwin’s custom stored procedures provide fast import and export capabilities. You can use ERwin’s data modeling tools to design applications that are stored in the Designer/2000 repository, or reverse engineer existing designs into an ERwin diagram.

You can use ERwin’s export capability to save a diagram into the Designer/2000 repository. ERwin creates a PL/SQL script which it uses to insert the elements in the diagram, including entities, attributes, and relationships, into the Designer/2000 repository. Similarly, you can use ERwin’s import capability to create a logical data model from an existing application in the Designer/2000 repository.

Related Topics

  Installing Designer/2000 Stored Procedures

  Selecting a Target Repository

  Importing Model Information from Designer/2000

  Exporting Model Information to Designer/2000

  Troubleshooting Errors Generated During Export


Installing Designer/2000 Stored Procedures

ERwin includes a set of functions and stored procedures that are used with Designer/2000. The functions and stored procedures are called by the PL/SQL scripts that ERwin creates during forward engineering which is copied into your ERwin program directory by the installation program. In order to create these functions and procedures in the repository database, you need to execute the commands in the ERWINSSF.SIX script file. When you execute this script, it creates the required functions and stored procedures in the repository database.

Related Topics

  To create Designer/2000 functions and stored procedures

  Summary of ERwin Function and Stored Procedure Files


To create Designer/2000 functions and stored procedures

1.	Follow the Designer/2000 server installation guidelines before you install the ERwin stored procedures.

2.	If you installed ERwin in a directory other than the default directory, edit the ERWINSSF.SIX script using a text editor and globally replace the default installation directory string C:\ERWMM with the appropriate path (i.e., the location of the .SIX files).

3.	Use SQL*Plus to connect to the database as the user that owns the repository instance and has execute rights on the Designer/2000 API.

4.	Run the ERWINSSF.SIX script. This script executes all the .SIX files and creates the ERwin stored procedures and functions for Designer/2000.

Note:	If you encounter compilation errors during the creation of the ERwin stored procedures or functions, try to execute each line of the script separately on the SQL*Plus command line.

Use the SHOW ERRORS command from SQL*Plus and communicate compilation errors to the Logic Works technical support department.


Summary of ERwin Function and Stored Procedure Files

The following table lists the set of function and stored procedure files for Designer/2000. In order to create these functions and procedures in the repository database, you need to execute the commands in the ERWINSSF.SIX script file.

File Type	File Name	Description
Function	ERWENTIN.SIX	Inserts ERwin entities into the Designer/2000 repository.
	ERWATTIN.SIX	Inserts ERwin attributes into the Designer/2000 repository.
	ERWRELIN.SIX	Inserts ERwin relationships into the Designer/2000 repository.
	ERWRENIN.SIX	Inserts ERwin relationship ends into the Designer/2000 repository.
	ERWUIEIN.SIX	Inserts ERwin primary keys or identifying relationships into the Designer/2000 repository as UIEs.
	ERWATVIN.SIX	Inserts valid ERwin domain values into the Designer/2000 repository as attribute values.
	ERWDOMIN.SIX	Inserts ERwin UDDS into the Designer/2000 repository as domains.
	ERWDVVIN.SIX	Inserts attribute valid values in the Designer/2000 repository as attribute values.
	ERWENTDL.SIX	Deletes an ERwin entity from the Designer/2000 repository.
	ERWSTAPP.SIX	Starts an Designer/2000 CDAPI activity.
Stored Procedure	ERWENTTX.SIX	Inserts ERwin entity descriptions into the Designer/2000 repository.
	ERWATTTX.SIX	Inserts ERwin attribute descriptions into the Designer/2000 repository.
	ERWACABT.SIX	Terminates an API activity in case of an error.
	ERWACCLS.SIX	Closes an Oracle API activity.


Selecting a Target Repository

You can use ERwin to export models to the Designer/2000 repository. When the target repository is Designer/2000, the target server is automatically set to Oracle since Designer/2000 repositories require Oracle servers. ERwin also includes a Target Repository feature that can be used two ways:

•	If you want to create Designer/2000 models, choose Designer/2000 as the target repository.

•	If you want to create a schema for any of the wide range of database servers supported by ERwin, choose System Catalog as the target repository (the default). See Selecting the Target Server During Reverse Engineering for more information.

Related Topics

  To change the target repository


To change the target repository

1.	Choose the Target Repository option on the Server menu.

2.	Choose one of the following options:

•	To have ERwin produce schema generation statements and datatypes that match the syntax and datatypes required by the currently selected target server, click the System Catalog option.

•	To have ERwin create a PL/SQL script to generate Designer/2000 elements and use Designer/2000 datatypes, click the Designer/2000 option.

3.	Click OK.


Importing Model Information from Designer/2000

ERwin can import information from a Designer/2000 repository. To import, you simply choose the name and version, then ERwin imports the information. When ERwin completes the import, it displays the imported information in a new ERwin diagram.

ERwin enforces rules that prevent you from assigning the same name to two or more attributes. Designer/2000 does not enforce such a rule at the logical level. Consequently, if a Designer/2000 model has two entities with a relationship between them, it is possible that in ERwin, an attribute from one entity could migrate to the other entity which already contains an attribute with the same name as the migrated attribute. ERwin would normally unify the attribute names. To avoid this potential problem, when ERwin imports a Designer/2000 model, it uses the Designer/2000 short name as a rolename and prefixes it to the attribute name to ensure that each attribute name is unique when imported into ERwin.

Related Topics

  To import model information from Designer/2000

  Import and Export Features and Limitations


To import model information from Designer/2000

1.	Choose Designer/2000 on the File menu, then choose Import.

2.	Type your user name, password, and connection string.

3.	Click Connect.

4.	Choose an application from the Application Name list box and a version from the Application Version list box.

5.	Click Continue. ERwin imports the information and displays the resulting diagram.


Exporting Model Information to Designer/2000

When you export model information to Designer/2000, you can specify the information that is included in the PL/SQL script. Once you establish a connection to the Designer/2000 repository, you can choose the name and version number of the application to which you want to export model information. Then, you can forward engineer the ERwin data model, or part of it, to the Designer/2000 repository where it is automatically integrated with the selected Designer/2000 application information. See Forward Engineering/Generating a Database Schema for more information.

The purpose of each control in the Designer/2000 Schema Generation Report dialog is explained below:

•	Create Entity. Select this check box to add entity names to the Designer/2000 repository. See Entity Plural Names for more information.

•	Delete Entity. Select this check box to drop the entity names in the current model from the Designer/2000 repository.

•	Comments. Select this check box to add attribute and entity definitions to the Designer/2000 repository as attribute and entity comments.

•	Create Relationships. Select this check box to add relationship information to the Designer/2000 repository.

•	Create Domains. Select this check box to add domain information to the Designer/2000 repository.

•	Create UIE. Select this check box to add primary key, alternate key, and identifying/non-identifying relationship information to the Designer/2000 repository. See Primary and Alternate Key Conversion for more information.

•	Filter. Click this button to open the Report Filter Editor. See Using the Report Filter Editor for more information.

•	Preview. Click this button to preview the PL/SQL script.

•	Print. Click this button to print the PL/SQL script to the default printer.

•	Report. Click this button to save the PL/SQL script to a file.

•	Generate. Click this button to execute the PL/SQL script against the target repository.

•	Close. Closes the dialog and cancels any changes.

Related Topics

  To export model information to Designer/2000

  Troubleshooting Errors Generated During Export

  Import and Export Features and Limitations


To export model information to Designer/2000

1.	Choose Designer/2000 on the File menu, then choose Export.

2.	Select each schema generation option that you want ERwin to include in the PL/SQL script.

3.	Click Generate. If you do not have a connection to the Designer/2000 repository, ERwin displays the <Database> Connection dialog. Enter your user name, password, and the connection string, then click Connect.

4.	Select the name of the Designer/2000 application that you want to export to in the Application Name box.

5.	Select the version of the Designer/2000 application that you want to export to in the Application Version box.

6.	Click Continue.

Note:	ERwin begins executing the script when you click Continue. If the Stop if Failure option is checked in the Generate Database Schema dialog, ERwin stops script execution when it detects an error. You can then choose to continue or stop script execution. When ERwin finishes executing the script, it displays a summary of the number of statements that succeeded and the number of statements that failed.


Troubleshooting Errors Generated During Export

The chart below provides information to help you correct problems that may occur during execution of the PL/SQL script.

Error Message	Problem	To Fix the Problem, Do This...
Entity insert failed	API did not start.	Check application validity and your assigned user’s privileges. See your Designer/2000 documentation for more information.
Domain insert failed	Incorrect datatypes may be used in the specified domain. An error occurs when physical datatypes are used in the domain assigned to an attribute. ERwin only supports Oracle Designer/2000 logical datatypes.	Change the domain datatype to an Oracle Designer/2000 logical datatype. See Using the Domain Dictionary Editor for more information.
Attribute insert failed	Incorrect datatypes may be used in the domain assigned to the specified attribute.	Change the domain datatype to an Oracle Designer/2000 logical datatype. See Using the Domain Dictionary Editor for more information.
Relationship insert failed	Parent or child entity for the specified relationship may not be included in the entity pool.	Check the Filter in the Schema Generation Report Editor to verify that the specified entity is included. See Using the Schema Generation Editor for more information.
UIE (Unique Identifier Entries) insert failed	ERwin automatically assigns the text string "Passive Verb" to any relationship that has not been assigned a specific name. This may result in multiple relationships having the same name.	For each relationship in ERwin, be sure to enter both a Parent-to-Child and a Child-to-Parent verb phrase. See Using the Relationship Editor in the Logical Model for more information.
Object not defined	Some or all of the ERwin functions and stored procedures were not created. Alternatively, the current user does not have permission to execute the existing functions and stored procedures.	Create ERwin functions and stored procedures. See Installing Designer/2000 Stored Procedures for more information.  To grant execute permission to another user and create the required synonyms, see your Designer/2000 documentation.


Import and Export Features and Limitations

You can use ERwin to exchange most important model information between ERwin and the Designer/2000 repository, but some information cannot be exchanged. In the table following, the column on the left shows the ERwin objects that can be stored in the Designer/2000 repository. The column on the right identifies the corresponding Designer/2000 element.

ERwin Object	Designer/2000 Element
Entity Name (Logical)  Entity Definition	Entity Entity Comment
Attribute Name (logical) Attribute Definition Attribute Valid Value Primary Keys  Foreign Keys Alternate Keys	Attribute Attribute Comment Attribute Value Attribute UIE (Sequence Number = 1) Relationship UIE Attribute UIE (Sequence Number > 1)
Identifying Relationship Non-Identifying Relationship Verb Phrase  (Parent-to-Child/Child-to-Parent)	Two Relationship Ends and a Relationship UIE Two Relationship Ends Relationship Text String (Active/Passive)
Incomplete Subtype Relationship	Entity Subtype
Domain Valid Value  Domain Default Value Domain Datatypes	Attribute Value
Note:	If multiple domains share the same valid values or default values, ERwin stores one unique value set for all domains in the data model. In contrast, Designer/2000 stores a complete value set for each domain in the application.

Related Topics

  Primary and Alternate Key Conversion

  Entity Plural Names

  Datatype Conversion

  Importing Model Information from Designer/2000


Primary and Alternate Key Conversion

When importing model information from the Designer/2000 repository into ERwin, ERwin imports attribute unique identifier entries (UIEs) with a sequence number of 1 as primary keys, and attribute UIEs with a sequence number greater than 1 as alternate keys. Relationships that are part of attribute UIEs with a sequence number of 1 are imported as identifying relationships. Relationships that are part of attribute UIEs with a sequence number greater than 1 are imported as non-identifying relationships.

When exporting model information from ERwin to the Designer/2000 repository, if you select the Create UIE option in the Designer/2000 Schema Generation Report dialog, ERwin exports primary keys as attribute UIEs with a sequence number of 1, and alternate keys as attribute UIEs with a sequence number greater than 1. Identifying relationships are included with UIEs with a sequence number of 1.

Related Topics

  Exporting Model Information to Designer/2000


Entity Plural Names

Designer/2000 lets you enter a plural name when specifying the name of an entity. If you do not specify a plural name, Designer/2000 automatically assigns one since it uses the plural entity name when it generates the physical table corresponding to an entity. When you import Designer/2000 model information, ERwin stores the plural name of each entity as the physical entity name.

Related Topics

  Exporting Model Information to Designer/2000


Datatype Conversion

In ERwin, the datatypes available for assignment to attributes depend on the target repository and the target server.

•	If the Target Repository option is Designer/2000, the datatypes available for assignment to attributes are the set of datatypes supported by Oracle Designer/2000.

•	If the Target Repository option is System Catalog, the datatypes available for assignment to attributes are the set of datatypes supported by the currently selected target server.

If the Target Repository option is Designer/2000, and you choose to forward engineer the ERwin model to a database, ERwin uses target server datatypes that correspond to the Designer/2000 datatypes. The underlying datatypes remain unchanged.

Similarly, if the Target Repository option is set to System Catalog, and you choose to export the ERwin model to Designer/2000, ERwin uses Designer/2000 (Oracle) datatypes that correspond to the currently selected target server datatypes. The underlying datatypes remain unchanged.

Related Topics

  Selecting a Target Repository


Modeling for the Data Warehouse

Data warehouses take the burden of extensive query operations off production databases and allow users to extract information more efficiently and easily. A data warehouse typically provides a quick response to complicated queries and is designed to answer business questions about a production system. For instance, “What is the total revenue generated by a particular product in a particular market?” In a data warehouse based on a star schema, many important joins are already done for you that simplify processing for decision support users.

Characteristics of a well-designed data warehouse include:

•	A design that is easily understood by users.

•	Mostly static, historical data that is updated on a scheduled basis: daily, weekly, quarterly.

•	Simplification of advanced business measurements, which might have required multiple SQL statements in a traditional RDBMS.

•	Support for complex SQL queries that make comparisons or require sequential processing of thousands or millions of records.

•	Support for multiple, large or iterative result sets.

A poorly designed data warehouse with normalized data makes the schema too complex, makes it hard for users to navigate through the schema, and degrades query performance.

Related Topics

  Analyze Your Business Before You Model

  Building an Effective Data Warehouse

  Star Schema Design

  To convert an entity relationship model to a dimensional model

  Documenting Your Dimensional Model


Analyze Your Business Before You Model

Before you create a database with a star schema design, analyze your business to discover the business questions your company needs answers for. Identify the central business question among all of these questions and begin modeling that one question.

Use the business question to identify the data to put in the fact table of your model. For example, if you want to determine the total amount of revenue generated by movies rented from a particular store by out of state customers for the month of January, design your model so that each record in the fact table represents the total revenue generated by a specific movie rental in a market on a given day by a given customer. In this example, the fact table contains monetary and additive data, and the dimension tables contain constraining data for customer, movie, market, and time.

As you determine what tables and data you required to answer your business question, keep in mind that a star schema contains relatively few tables with well-defined table relationships, or joins. In contrast to the normalized structure used for relational databases, this database design provides fast query response time by denormalizing and partitioning data.

Related Topics

  Modeling for the Data Warehouse

  Building an Effective Data Warehouse

  Star Schema Design


Building an Effective Data Warehouse

The most efficient way to build an effective data warehouse is to use a dimensional model to design it. Dimensional modeling is a database design methodology that is used to design data warehouses. Dimensional modeling for a data warehouse is similar to entity relationship modeling for an RDBMS. Both modeling techniques provide a methodology that facilitates the creation of effective well-designed databases. They differ, however, in their approach to business questions and design goals. An entity relationship model focuses on data integrity and efficiency of data entry so that you can enter each piece of data, such as customer address, only once. In contrast, a dimensional model focuses on business processes and business questions.

As dimensional modeling has evolved, the experts in the field have begun to standardize on a specialized design called a star schema which provides fast query response time by denormalizing and partitioning data.

Related Topics

  Modeling for the Data Warehouse

  Analyze Your Business Before You Model

  Star Schema Design

  Characteristics of a Star Schema


Star Schema Design

A star schema refers to a dimensional model built in a star configuration. The star schema typically contains one large table, called the fact table , placed in the center with smaller satellite tables, called dimension tables , joined to the fact table in a radial pattern. A star schema can optionally have outrigger tables joined to a dimension table.

In the example of a video rental store data warehouse below, the REVENUE table is a fact table; Customer, Movie, Market, and Time are dimension tables; and District and Region are outrigger tables. The REVENUE fact table contains revenue data for movies rented by each customer, in a geographic market, over a period of time. The dimension tables in this database define the customers, movies, markets, and time periods used in the fact table.

You can display icons to graphically represent that a table is a fact, dimension, or outrigger. See Dimensional Icon Display Option for more information.

Related Topics

  Modeling for the Data Warehouse

  Building an Effective Data Warehouse

  Characteristics of a Star Schema


Characteristics of a Star Schema

The star schema is extremely suitable for data warehouse database design because it:

•	Creates a denormalized database that can quickly provide query responses.

•	Provides a flexible design that can be changed easily or added to throughout the development cycle, and as the database grows.

•	Provides a parallel in design to how end users typically think of and use the data.

•	Reduces the complexity of meta data for both developers and end users.

Related Topics

  Star Schema Design

  Building an Effective Data Warehouse


Fact Table

The fact table is the central table in a star schema diagram. It can consist of millions of rows and contains the additive or factual data about a business that can help you answer your business questions. It brings together data that would reside in multiple tables throughout the database in traditional relational databases.

Fact tables and dimension tables are related by identifying relationships, so that the dimension table primary keys migrate to the fact table’s primary key as foreign keys. In the example, the REVENUE fact table’s primary key is composed of four foreign keys: movie_key, customer_key, market_key, and time_key. The fact table’s primary key is made up of the primary keys of all the dimension tables.

Each row can be uniquely identified by the primary key, which is a concatenation of the primary keys of the dimension tables.

Related Topics

  Star Schema Design

  Assigning Dimensional Modeling Roles

  Conformance Warnings


Assigning Dimensional Modeling Roles

ERwin determines if a table is a fact, dimension, or outrigger table based on its dimensional modeling role.

By default, ERwin automatically assigns a role to the table based on the relationship(s) drawn to other tables. ERwin considers a table with no relationships to be a dimension table. When you draw a relationship from one table to another, ERwin determines if the child table in the new relationship acts as a parent in any other relationship. Based on this information, ERwin automatically assigns dimensional modeling roles as follows:

ERwin assigns a …	If the table has…
Fact role	No parent relationships
Dimension role	No relationships to any tables
	A parent relationship to a Fact table
	Both parent and child relationships
Outrigger role	A parent relationship to a Dimension table
You can override the manual assignment of roles by ERwin on a table-by-table basis in the Dimensional tab of the Table Editor.

When you manually assign a dimensional modeling role, ERwin does not automatically change your role setting based on relationships drawn to other tables. However, if you select the Display conformance warnings option in the Preferences dialog, ERwin displays a conformance warning if the role you manually assign conflicts with dimensional modeling standards.

Related Topics

  To manually assign dimensional modeling roles

  To display dimensional conformance warnings

  Conformance Warnings


To manually assign dimensional modeling roles

1.	Choose Table on the Edit menu and click the Dimensional tab.

2.	Clear the Calculate Automatically check box.

3.	Click the role you want to assign: Fact, Dimension, or Outrigger.

4.	Click OK.

Note: 	If you select Display conformance warnings in the Methodology tab of the Preferences dialog, ERwin displays a warning when manual dimensional modeling role assignments violate dimensional modeling standards. See Conformance Warnings for more information.


To display dimensional conformance warnings

1.	Choose Preferences on the Option menu and click the Methodology tab.

2.	Click the DM (Dimensional Modeling) notation for your physical model.

3.	Select the Display conformance warnings check box.

4.	Click OK.


Conformance Warnings

If you select the Display conformance warnings option in the Preferences dialog, ERwin displays a conformance warning if the role you manually assign conflicts with dimensional modeling standards which dictate that:

•	A fact table cannot have any parent relationships.

•	A fact table cannot be the child of an outrigger table.

•	A fact table must have a child relationship.

•	An outrigger table cannot have a parent relationship to a fact table.

•	An outrigger table must have a parent relationship.

•	The child of an outrigger table must be a dimension table.

Related Topics

  To display dimensional conformance warnings

  To manually assign dimensional modeling roles

  Assigning Dimensional Modeling Roles


Dimension Table

Dimension tables are the satellite, or minor, tables in a dimensional model. Dimension tables have fewer rows than fact tables and contain descriptive information about the business such as customers or product information. These tables enable the business user to quickly drill down from the fact table to additional information in key business areas.

Dimension tables relate directly to the fact table with identifying relationships, so that the dimension table primary keys migrate to the fact table’s primary key as foreign keys. In the example below, the REVENUE fact table’s primary key is the concatenation of the primary keys of the dimension tables: movie_key, customer_key, market_key, and time_key.

If a dimension table contains too many rows for efficient querying, you can partition the data horizontally or vertically depending on the needs of your data warehouse. To maintain the drill down capability relate each dimension partition to the fact table. See Partitioning Large Dimension Tables for more information.

Related Topics:

  Star Schema Design

  Assigning Dimensional Modeling Roles

  Conformance Warnings

  Accounting for Slowly Changing Dimensions


Partitioning Large Dimension Tables

In the case where a denormalized dimension table is extremely large and you need to query a portion of the columns more often than the rest, you may want to break the single dimension table into two separate dimension tables (create a vertical partition) for efficiency. You can then relate the two tables to each other with a non-identifying relationship so that you can browse both dimensions interactively.

For example, if the Customer dimension table contains both customer address and demographic information, users may query the demographic fields such as, age, gender, income_level, and marital_status more frequently then they query the other columns. In this case, separating the demographic columns into another table improves query response time. In order to maintain the relationship between the demographic and customer columns, the demographic key should be a foreign key in the Customer dimension table.

Related Topics

  Dimension Table

  Star Schema Design


Outrigger Table

Although they are not required for a star schema, ERwin also supports the use of secondary dimension tables called outrigger tables. Outrigger tables can only be related to dimension tables, where the outrigger table is the parent and the dimension table is the child. The relationship may be identifying or non-identifying. An outrigger table cannot be related to a fact table. You can use outrigger tables to normalize data in dimension tables, though most data warehouse experts recommend against normalizing data in a warehouse because it reduces the querying performance gained by a star schema.

When outrigger tables are used in a dimensional model to decompose, or normalize, dimension hierarchies for each many-to-one relationship, the model is called a snowflake schema.

Related Topics

  Snowflake Schema

  Star Schema Design

  Assigning Dimensional Modeling Roles

  Conformance Warnings


Snowflake Schema

A snowflake schema is a term to describe a star schema structure normalized through the use of outrigger tables.

Though normalizing data is useful in entity relationship modeling, it reduces database efficiency in dimensional modeling. In a dimensional model the primary objective is to create a database that supports high performance browsing and querying. A snowflake schema typically hinders performance because it requires multiple joins in order to return a simple query result set which increases the query response time.

In the example above, the REVENUE fact table is joined to the dimension tables Customer, Movie, Market, and Time, which are each joined to two outrigger tables.

Related Topics

  Outrigger Table

  Star Schema Design

  Building an Effective Data Warehouse


To convert an entity relationship model to a dimensional model

1.	Open an existing entity relationship (ER1) model.

2.	Choose Preferences on the Option menu and click the Methodology tab.

3.	Click DM (Dimensional Modeling).

4.	Select the Display conformance warnings check box if you want ERwin to prompt you when relationships and table roles violate dimensional modeling standards.

5.	Click OK.

Note:	After you close the Preferences dialog, ERwin asks if you want to redraw the diagram relationship lines as diagonal lines or keep the orthogonal lines. Dimensional models are typically drawn with diagonal lines.


Associative Tables in DM Notation

If you create a many-to-many relationship between two tables in a logical model, ERwin creates an associative fact table in the physical model to resolve the many-to-many relationship.

Related Topics

  Resolving Many-to-Many Relationships

  Creating a Many-to-Many Relationship


Documenting Your Dimensional Model

In the data warehouse environment, it is important to track the source of data (where); the method by which the source data is extracted, transformed, and cleansed before it is imported into the data warehouse (how); and the frequency and timing of data warehouse updates (when). You may have a data warehouse that combines information from several OLTP systems, as well as archive data, into a single decision support system. Your data may also come from relational and non-relational sources. In order to support regular updates and data quality checks, you need to know the source for each column in your data warehouse. You also need to know when and how the data is updated. You can document all of this information using the following ERwin editors:

•	Data Warehouse Source Editor. Use to define sources of data for your data warehouse.

•	Column Editor . Use to document data warehouse source assignments and transform information for each column in your dimensional model in the Data Source tab.

•	Data Warehouse Rule Editor . Use to document the data warehouse maintenance processes required to regularly update each table in your dimensional model.

ERwin also tracks the dimensional modeling role of each table in your model and lets you include flags for slowly changing dimensions in the Dimensional tab of the Table Editor. See Specifying Dimensional Modeling Table Options for more information.

Note:	Dimensional modeling tools are only available when you select DM (Dimensional Modeling) notation in your physical model. See To select modeling notation preferences for more information.

Related Topics

  Using the Column Editor

  Using the Table Editor

  Specifying Data Warehouse Sources


Using the Data Warehouse Rule Editor

Using the Data Warehouse Rule Editor, you can document the data warehouse maintenance rules associated with the tables in your dimensional model. ERwin supports six types of standard management rules: Refresh, Append, Backup, Recovery, Archiving, and Purge. The editor contains a filter control that you can use to display all rules or only rules in a specific type.

Choose Data Warehouse Rules from the Edit menu to open the Data Warehouse Rule Editor. The Data Warehouse Rule Editor is only available when DM (Dimensional Modeling) notation is selected for your physical model.

The Data Warehouse Rule Editor includes the following tabs:

•	Definition. Enter a definition for the rule selected in the grid.

•	Attachment. Attach the rule selected in the grid to tables in your dimensional model.

The purpose of each control in the Data Warehouse Rule Editor is explained below:

•	. Adds a row.

•	. Deletes the selected row.

•	Rule Name. Type or edit the name of the data warehouse rule.

•	Type. Select the rule type from the list.

•	Type Filter. Select the type of rule that you want to display in the grid. To see all rule types, select All from the list.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To create a data warehouse rule

  To delete a data warehouse rule

  To attach a data warehouse rule in the Table Editor

 To select dimensional modeling notation

  Documenting Your Dimensional Model

  Creating a Data Warehouse Rule Report


To create a data warehouse rule

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Rule on the Edit menu.

3.	Click the [image] button to add a new row in the grid.

4.	Type a rule name in the Rule Name column in the new row with a [image] button.

5.	Click in the Type column of the new row and click on the [image] button, then select a rule type from the list.

6.	Type a definition for the rule. More>

7.	Attach the rule to one or more tables in the model. More>

8.	Click OK.


To delete a data warehouse rule

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Rule on the Edit menu.

3.	Click the [image] button before the rule name you want to delete.

4.	Click Yes to remove the data rule from all objects.

5.	Click OK.


Entering a Data Warehouse Rule Definition

You use the Definition tab in the Data Warehouse Rule Editor to enter or edit a definition for a data warehouse rule. The definition that you enter should help any person who reads the data model to understand when and how frequently data in the attached data warehouse tables is updated. You may also want to include a typical duration of the process.

The purpose of each control in the Definition tab is explained below:

•	Definition. Type or edit the data warehouse rule definition in this text box.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Using the Data Warehouse Rule Editor

  To enter or edit a data warehouse rule definition


To enter or edit a data warehouse rule definition

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Rule on the Edit menu.

3.	Select or create a data warehouse rule in the Rule Name column. More>

4.	Click the Definition tab.

5.	Type or edit a definition for the data warehouse rule.

6.	Click OK


Attaching a Data Warehouse Rule to a Table

You can use the controls in the Attachment tab of the Data Warehouse Rule Editor to attach a data warehouse rule to one or more tables in a model.

The purpose of each control in the Attachment tab is explained below:

•	Unattached Tables. Displays the tables to which you can attach the selected rule. Double-click an object to move it from the Unattached Tables list to the Attached Tables list.

•	Attached Tables. Displays the tables to which the selected rule is attached. Double-click an object to move it from the Attached Tables list to the Unattached Tables list.

•	. Moves the selected table from the Unattached Tables list to the Attached Tables list.

•	. Moves the selected table from the Attached Tables list to the Unattached Tables list.

•	. Moves all tables from the Unattached Tables list to the Attached Tables list.

•	. Moves all tables from the Attached Tables list to the Unattached Tables list.

Related Topics

  Using the Data Warehouse Rule Editor

  To attach a data warehouse rule in the Data Warehouse Rule Editor

  To detach a data warehouse rule in the Data Warehouse Rule Editor


To attach a data warehouse rule in the Data Warehouse Rule Editor

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Rule on the Edit menu.

3.	Select or create a data warehouse rule in the Rule Name column. More>

4.	Click the Attachment tab.

5.	Select the tables to which you want to attach the selected rule using any combination of the methods described below:

•	Double-click a table in the Unattached Tables list to move the table from the Unattached Tables list to the Attached Tables list.

•	Select a table in the Unattached Tables list, then click the [image] button to move the table from the Unattached Tables list to the Attached Tables list.

•	Click the [image] button to move all tables from the Unattached Tables list to the Attached Tables list.

6.	Click OK when the Attached Tables list contains the tables to which you want to attach the rule.

7.	Click OK


To detach a data warehouse rule in the Data Warehouse Rule Editor

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Rule on the Edit menu.

3.	Select a data warehouse rule in the Rule Name column.

4.	Click the Attachment tab.

5.	Select the tables you want to detach from the selected rule using any combination of the methods described below:

•	Double-click a table in the Attached Tables list to move the table from the Attached Tables list to the Unattached Tables list.

•	Select a table in the Attached Tables list, then click the [image] button to move the table from the Attached Tables list to the Unattached Tables list.

•	Click the [image] button to move all tables from the Attached Tables list to the Unattached Tables list.

6.	Click OK when the Attached Tables list contains the tables to which you want to attach the rule.

7.	Click OK


Specifying Data Warehouse Sources

In the data warehouse environment, it is important to track the source of data. You may have a data warehouse that combines information from several online transaction processing (OLTP) systems, as well as archive data, into a single decision support system. Your data may also come from relational and non-relational sources. In order to support regular updates and data quality checks, you need to know the source for each column in your data warehouse.

For example, in the Moviedim.er1 dimensional model, the information about stores may come from the corporate production database, while the information about customers comes from both the production system and a data archive. When the administrator updates the data, he or she must know the source of the data and its structure (datatype) in order to run the proper extracts.

The ERwin Data Warehouse Source Editor can help you track and report on the source for each data warehouse column. Specifying data warehouse sources helps you to document the relationships between your data warehouse data and the data in your OLTP systems. Table and column names and column datatypes can be easily imported from an .er1 or .erx file, ModelMart diagram, database, DDL script, or comma delimited file and subsequently referenced as the data warehouse source. Also, when you copy and paste objects between models, ERwin updates the data warehouse source information automatically.

Related Topics

  Using the Data Warehouse Source Editor

  Documenting Your Dimensional Model


Using the Data Warehouse Source Editor

Using the Data Warehouse Source Editor, you can manually define data sources or import source information from an existing database, script file, ER1 or ERX file, ModelMart diagram, or comma-delimited flat file.

Choose Data Warehouse Source from the Edit menu to open the Data Warehouse Source Editor. The Data Warehouse Source Editor is only available when you select DM (Dimensional Modeling) notation for your physical model.

The Data Warehouse Source Editor includes the following tabs:

•	General . Enter the system name, source host, and DBMS type for the source selected in the grid.

•	Detail . Define or import the table and column names, the column datatype, and column comment for the source selected in the grid.

•	Definition . Enter a definition for the source selected in the grid.

The purpose of each control in the Data Warehouse Source Editor is explained below:

•	. Adds a row.

•	. Deletes the selected row.

•	Source Name. Type or edit the name of the source.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To create a data warehouse source

  To delete a data warehouse source

  To specify general data warehouse source information

  To enter or edit a data warehouse source definition

  Specifying Data Warehouse Sources


To create a data warehouse source

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Source on the Edit menu.

3.	Click the [image] button to add a new row in the grid.

4.	Type a source name in the Source Name column in the new row with a [image] button.

5.	Enter the system name, host name, and DBMS type for the source. More>

6.	Define the tables and columns for the source. More>

7.	Enter a definition for the source. More>

8.	Click OK.


To delete a data warehouse source

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Source on the Edit menu.

3.	Click the [image] button before the source name you want to delete.

4.	Click Yes to delete the data warehouse source from the model.

5.	Click OK.


Specifying General Data Warehouse Source Information

You can use the controls in the General tab of the Data Warehouse Source Editor to specify the system name, host name, and DBMS type of the selected data warehouse source.

The purpose of each control in the General tab is explained below:

•	System Name. Type the name of the system in which the source data is located.

•	Host Name. Type the name of the host server for the source data.

•	DBMS Type. Select the type of database management system (DBMS) in which the source data is located.

•	Version. Select the version of the DMBS.

•	Relational. Click this button if the source data is in a relational format, such as an ERwin model, a ModelMart diagram, a database, or a script file.

•	Flat File. Click this button if the source data is in a comma delimited file.

•	Imported From. If you imported the data warehouse source, ERwin displays the name of the database, script file, ER1 or ERX file, ModelMart diagram, comma delimited file from which you imported the source data.

Related Topics

  Using the Data Warehouse Source Editor

  To specify general data warehouse source information


To specify general data warehouse source information

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Source on the Edit menu.

3.	Select or create a data warehouse source in the Source Name column. More>

4.	Click the General tab.

5.	Type the name of the system in which the data source is located in the System Name text box.

6.	Type the name of the host server for the source data in the Host Name text box.

7.	Select the DBMS Type and DMBS Version in which the source data is located.

8.	Select whether the source data is Relational or from a Flat File.

9.	Click OK.


Defining and Importing a Data Warehouse Source

You use the Detail tab in the Data Warehouse Source Editor to manually define tables and columns of a data warehouse source or import source information from an existing database, script file, ER1 or ERX file, ModelMart diagram, or flat file.

The purpose of each control in the Detail tab is explained below:

•	Tables. Displays the list of defined tables in the selected data warehouse source.

•	New. Opens the New Table dialog and adds a new table to the Tables list.

•	Rename. Opens the Rename Table dialog and edits the name of the selected table.

•	Delete. Deletes the selected table from the selected data warehouse source.

•	Columns. Displays the columns in the selected table. Click on the Name heading to sort columns alphabetically by name. Click on the Datatype heading to sort columns alphabetically by datatype. You can add a new column manually by clicking the [image] button and typing the column name, datatype and optional comment in the new row marked with a [image] button.

•	Import. Opens the Set Options dialog from which you can select a source of data to import as a data warehouse source.

Related Topics

  Using the Data Warehouse Source Editor

  To import a data warehouse source

  To add a table to a data warehouse source

  To add a column to a data warehouse source

  To remove a table from a data warehouse source

  To remove a column from a data warehouse source


To import a data warehouse source

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Open the Data Warehouse Source Editor in one of the following ways:

•	Choose Data Warehouse Source on the Edit menu.

•	Click the [image] (Data Sources) button on the Data Source tab of the Column Editor or Domain Dictionary Editor.

•	Click the [image] (Available Sources) button on the Data Warehouse Source Selector dialog.

3.	In the Data Warehouse Source Editor, select or create a data warehouse source in the Source Name column. More>

4.	Click the Detail tab.

5.	Click the Import button to open the Set Options dialog and select options. More>

•	Select the source from which you want to import data.

•	Select the items to import.

•	Select import options.

•	Select case conversion of physical names options.

6.	Click the Next button to open the Resolve Differences dialog. If you are not logged on to the target database, ERwin first displays the <Database> Connection dialog, then opens the Resolve Differences dialog after successfully logging on and reading the database structures.

7.	If a table you do not want to import is listed, highlight the table and click the Ignore button. More>

8.	Click the Finish button. The imported tables and their columns display in the Detail tab of the Data Warehouse Source Editor.


To add a table to a data warehouse source

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Source on the Edit menu.

3.	Select or create a data warehouse source in the Source Name column. More>

4.	Click the Detail tab.

5.	Click the New button to open the New Data Source Table dialog.

6.	Type the name of the table and click OK.

7.	Add columns for the table. More>

8.	Click OK.


To add a column to a data warehouse source

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Source on the Edit menu.

3.	Select or create a data warehouse source in the Source Name column. More>

4.	Click the Detail tab.

5.	Click the [image] button in the Columns grid to add a new row.

6.	Type a Column Name in the in the new row with a [image] button.

7.	Type a Datatype for the column.

8.	Type a Comment for the column.

9.	Click OK.


To remove a table from a data warehouse source

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Source on the Edit menu.

3.	Select a data warehouse source in the Source Name column.

4.	Click the Detail tab.

5.	Click the name of the table you want to delete in the Tables list.

6.	Click Remove.


To remove a column from a data warehouse source

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Source on the Edit menu.

3.	Select a data warehouse source in the Source Name column.

4.	Click the Detail tab.

5.	Click the name of the table that contains the column you want to delete in the Tables list.

6.	Click the [image] in front of the column you want to delete in the Columns list.


Entering a Data Warehouse Source Definition

You use the Definition tab in the Data Warehouse Source Editor to enter or edit a definition for a data warehouse source. The definition that you enter should help any person who reads the data model to understand where the source data is located and how it is included in the data warehouse.

The purpose of each control in the Definition tab is explained below:

•	Definition. Type or edit the data warehouse source definition in this text box.

•	. Cuts, copies, and pastes text using the Clipboard.

. Opens the ERwin Text Editor.

Related Topics

  Using the Data Warehouse Source Editor

  To enter or edit a data warehouse source definition


To enter or edit a data warehouse source definition

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Data Warehouse Source on the Edit menu.

3.	Select or create a data warehouse source in the Source Name column. More>

4.	Click the Definition tab.

5.	Type a definition for the data warehouse source.

6.	Click OK


Setting Options for Data Warehouse Source Import

When you click the Import button in the Detail tab of the Data Warehouse Source Editor, the Set Options dialog opens. When you are finished setting options, you can select the specific tables to import. See Selecting Tables to Import as Data Warehouse Source for more information.

The purpose of each control in the Set Options dialog is explained below:

•	Import Data Warehouse Source From. Select the source of data that you are importing.

•	Database. Click this button to import data from an existing database.

•	Script File. Click this button to import data from an existing SQL DDL script file. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	ModelMart Diagram. Click this button to import data from a model stored in ModelMart. This option is available if you are currently logged on to ModelMart.

•	ER1/ERX File. Click this button to import data from an existing ER1 or ERX file.

•	File Name. Type the name of the file (e.g., C:\Erwin35\Movies.er1) or ModelMart diagram (e.g., mylibrary..mymodel) that you want to import data from. If you click the Browse button and select a file, ERwin automatically displays the name of the file or diagram you selected in this text box. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	Browse.  ERwin enables the Browse button if you click the Script File, ER1/ERX File, or ModelMart button. When you click Browse ERwin displays the Open dialog so that you can select a path and the name of an existing SQL DDL script, ER1/ERX file, or ModelMart model. This option is not available for Access, Clipper, dBASE, FoxPro, and Paradox target servers.

•	Items to Import. Select the items that you want to import from the selected source of data.

•	Option Set (combo box). Enter a name for a user-defined set of options, update the name of an existing option set using the standard editing keys, or select a user-defined option set.

•	New. Saves the selected items as a named option set. ERwin saves the settings in the Options Set list box under the name specified in the Option Set combo box.

•	Update. Updates an existing option set. ERwin saves the new settings and updates the option set name.

•	Delete. Deletes a saved option set.

•	Option Set (list box). Displays a complete list of the database items supported by the target database. Clear the check box next to an item if you do not want ERwin to import. Select the check box if you want ERwin to import that type of item. ERwin uses these settings to filter the display list in the Resolve Differences dialog.

•	Options. Specify which tables in the selected database should be imported. For example, if you choose to import data from only those tables owned by the current user, ERwin ignores all other tables in the database during the import.

•	System Tables. Select this check box to import data from both system and user tables. Clear the check box (default) to import data from user tables only.

•	Tables Owned By (group box). Import data based on owner name:

•	All (default). Click this button to import data from all tables and views in the database, regardless of the owner.

•	Current User. Click this button import data from only those the tables or views owned by the current user as entered in the User Name text box on the <Database> Connection dialog.

•	Owners (comma separated). Click this button to import data from the tables/views owned by the owner name or names (separated by commas) specified in this box.

•	Case Conversion of Physical Names. Select a case conversion option for import.

•	None. Click this button if you want ERwin to preserve the case of physical names exactly as they appear in the target database, SQL DDL script, or ER1/ERX file. ERwin imports the names without case conversion.

•	lower case. Click this button if you want ERwin to change physical names to lowercase during import (e.g., ERwin converts the table name Movie_copy to movie_copy).

•	UPPER CASE. Click this button if you want ERwin to change physical names to uppercase during import (e.g., ERwin converts the table name Movie_copy to MOVIE_COPY).

•	<Back. Returns to the Data Warehouse Source Editor.

•	Next>. Opens the Resolve Differences dialog. If you are not logged on to the target database, ERwin first displays the <Database> Connection dialog, then opens the Resolve Differences dialog after successfully logging on and reading the database structures.

•	Cancel. Cancels the import data warehouse source process.

Related Topics

  Defining and Importing a Data Warehouse Source


Selecting Tables to Import as Data Warehouse Source

When you click Next> in the Set Options dialog, ERwin reads the database, DDL script, ERwin data model, or ModelMart diagram from which you want to import, and displays the Resolve Differences dialog.

ERwin lists the new data warehouse source on the left and the referenced database, script, or model on the right. By default, ERwin sets the action for all tables in the source database or file to Import [image].

You can use the tool buttons available on the Resolve Differences dialog to assign an action to each item in the differences list. If a button is unavailable (dimmed) it is not a valid action for the selected item. Each tool in the dialog is explained in the table below:

Tool	Description	Tool Usage
	Marks one or more selected items for import from the target database, DDL script, ModelMart diagram, or ER1/ERX file.	Select the item(s) that you want to import and click the Import tool.
	Marks one or more selected items to be ignored.	Select the item(s) that you want ERwin to ignore click the Ignore tool.
	Marks one or more selected items for deletion.	Select the item(s) that you want ERwin to delete during import or export and click the Delete tool.
	Lets you match two items that you want that were not matched by ERwin automatically.	When you select the Match tool, ERwin changes the cursor to a double-ended arrow. Click on an item in the left side of the list, then click on an item in the right side. ERwin moves the items so that they appear on the same line.
	Lets you break the match between an item in your source definition and an item in the database, DDL script, ModelMart diagram, or ER1/ERX file.	Select the row containing the items that are incorrectly matched and click the Unmatch tool. ERwin moves the selected items to different lines.

The Resolve Differences dialogs also include an action bar in center of the Differences list box. Each item in the Differences list box is associated with a symbol on the action bar that displays the action that you selected for that item. See Resolve Differences Action Bar for more information on each type of action that ERwin displays on the action bar.

All other controls on the dialog are explained below:

•	Show Only Differences. Select this check box if you want ERwin to list only the differences between your source definition and the database, DDL script, ModelMart diagram, or ER1/ERX file. Clear the check box to show all item similarities and differences.

•	Report. Click this button to open the Comparison Report Options dialog. See Generating a Comparison Report for more information.

•	Preview. Click this button to open the Report Preview dialog.

•	< Back. Returns to the Set Options dialog.

•	Next >. Opens the Import Changes dialog if any items are selected for import.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  Defining and Importing a Data Warehouse Source


Using the Data Warehouse Source Selector

You can use the controls in the Data Warehouse Source Selector to select and deselect available data warehouse sources.

To open the Data Warehouse Source Selector, click [image] (Data Sources) in the Data Source tab of the Column Editor. The Data Source tab and Data Warehouse Source Selector are only available when you select DM (Dimensional Modeling) notation for your physical model.

The purpose of each control in the Data Warehouse Source Selector is explained below:

•	Available Sources. Lists the available data warehouse sources hierarchically by source, table, and column. Hint:  Double-click on a source column to add it to the Selected Data Sources list.

•	 (Available Sources). Opens the Data Warehouse Source Editor from which you can create or modify data warehouse source definitions.

•	Select. Adds the selected data source to the Selected Data Source list.

•	Selected Data Sources. Lists the selected source columns that ERwin attaches to the selected column when you close the dialog.

•	Deselect. Removes the selected data source from the Selected Data Source list.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To specify a data warehouse source

  To remove a data warehouse source

  To import a data warehouse source

  Specifying Data Warehouse Sources for a Column

  Specifying Data Warehouse Sources Using Domains


DM (Dimensional Modeling)

This methodology is typically used to diagram dimensional models and data warehouses. It graphically depicts Fact, Dimension, and Outrigger tables in a star schema.


Refresh

Completely replaces existing data.


Append

Updates the table with changes and additions. An append is like a delta update.


Backup

Creates a duplicate copy of the table contents in order to have data available for recovery purposes.


Recovery

Restores table data with backup data. The backup files contain data from a specific point in time. A recovery process is typically initiated when data is not accessible due to computer hardware failure, network failure, or any other unforeseen circumstances.


Archiving

Eliminates rows in a table based on criteria (like a date range) and saves them to an archive file which can be retained as a historical reference.


Purge

Eliminates rows in a table based on criteria (like a date range). The purged data is not saved in a separate file.


Editing and Arranging Diagram Objects

An ERwin diagram contains a variety of objects that you can move, copy, cut, and paste to enhance both the appearance and readability of your diagram. In a logical model, diagram objects include:

•	Entities

•	Text blocks

•	Subtype relationship symbols

A physical model includes the following diagram objects:

•	Tables

•	Views

•	Text blocks

Both logical and physical models also include relationship lines, which interconnect different diagram objects, and move with the objects when they are moved. You can also move relationship lines independently of their associated objects, to change the position of the line or to reduce the number of angles.

Related Topics

  Using Copy, Cut, and Paste

  Selecting Multiple Diagram Objects

  Moving Diagram Objects

  Adjusting the Size of Entities, Tables, and Views

  Aligning Diagram Objects Using the Layout Grid

  Adjusting Relationship Lines

  Redrawing the Diagram

  Letting ERwin Lay Out Your Diagram


Using Copy, Cut, and Paste

You can use the copy, cut, and paste features of ERwin to manage diagram objects and speed the creation of data models. Simply select the objects you want to copy or cut and then paste them into a new or existing diagram.

When you copy or cut a diagram object to the ERwin clipboard, everything about that object is retained and brought along. So, if you copy two entities connected by a relationship, when you paste them into another diagram, you get both entities, the connecting relationship, and other related information such as the entity and attribute definitions, verb phrases, notes, integrity constraints, rolenames, and foreign keys.

You can also cut, or delete, objects in an ERwin diagram without saving them to the clipboard. When you delete, you are also prompted to choose whether to remove the objects from the model, or just from the current subject area.

To assist you with integrating the information in your models with other types of information, such as word processor documents, spreadsheets, or presentations, ERwin also supports copying a picture of the diagram window to the Windows clipboard. You can then paste the picture into any other software application that supports the Windows metafile or bitmap file format.

Related Topics

  Copying Diagram Objects

  Using the Copy Dialog

  Pasting Diagram Objects

  Deleting Diagram Objects


Copying Diagram Objects

You can copy one or more diagram objects within the same ERwin model, or to a different ERwin model.

To copy one or more entities, tables, views, or text blocks that you have selected, you can:

•	Press the CTRL key then drag the selection to a blank portion of the diagram.

•	Click Copy (CTRL-C) on the Edit menu to open the Copy dialog. You can use the controls on the Copy dialog to copy a picture of the diagram to the Windows clipboard, or copy diagram objects to the same model or a different model.

To copy one or more attributes or columns that you have selected, you can:

•	Press the CTRL key, then click and drag the selection to a different entity or table, or to a different position in the same entity or table. See Copying Attributes or Columns in a Diagram for more information.

Note:	ERwin does not enforce unique naming when you copy an object. If you want all objects in your model to have unique names, you must change the names in all copied objects manually.

You cannot copy relationships unless you also copy both the parent and child entities or tables involved in the relationship.

Related Topics

  To copy an entity, table, view, or text block

  To copy attributes or columns in an ERwin model

  To copy diagram objects to a different diagram

  How Copying Affects Foreign Keys and Relationships

  Using the Copy Dialog


To copy an entity, table, view, or text block

1.	Select one or more entities, tables, views, or text blocks that you want to copy. More>

2.	While pressing the CTRL key, click and drag the selection to a blank location in the diagram.

3.	Drop the selection in its new location.

4.	To enforce unique naming in the diagram, change the name of all copied diagram objects.

Note:	When you copy a view using drag-and-drop, ERwin also copies the base tables associated with that view.


Copying Attributes or Columns in a Diagram

With the Attribute Manipulation tool [image], you can select one or more attributes or columns and copy the selection to a different entity, table, or view. To copy attributes or columns, press the CTRL key, then drag the selection to the new entity, table or view.

When you copy an attribute or column, ERwin displays an insertion bar tool [image] to show you where the attribute of column will be inserted. When you drop the attribute or column, ERwin automatically transfers the source object’s definition information (e.g., domain, definition, comment, notes, datatype, etc.) to the new location. You cannot duplicate an attribute in the same entity, or a column in the same table or view.

ERwin does not enforce the current Unique Name setting during copying. If you require unique names in your environment, you should immediately rename the attributes or columns that you copied to eliminate duplicate names.

Hint:	Use SHIFT-click to select a contiguous group of attributes or columns, and CTRL-click to select non-contiguous attributes or columns. To copy an entire entity, table, or view, click on the object name and press the CTRL key while dragging the copy to the desired location.

Related Topics

  To copy attributes or columns in an ERwin model

  To copy diagram objects to a different diagram


To copy attributes or columns in an ERwin model

1.	Click [image].

2.	Select one or more attributes or columns that you want to copy. More>

3.	While pressing the CTRL key, drag the attributes or columns to a different entity, table, or view.

4.	Drop the copied attributes or columns in the new location.

5.	To enforce unique naming in the diagram, change the names of all copied attributes or columns.


To copy diagram objects to a different diagram

1.	Open the diagram that contains the diagram objects you want to copy.

2.	Select the diagram objects you want to copy. More>

3.	Click Copy on the Edit menu or press CTRL+C.

4.	Click Model.

5.	Click OK.

6.	Open the second diagram.

7.	Click Paste on the Edit menu or press CTRL+V.

8.	Drag the pasted object(s) to a blank area of the diagram.

Note:	If you select individual entities in a subtype relationship and you want to copy the relationship between them, as well, you must select all entities plus the subtype symbol for the relationship lines to copy correctly. All other relationship lines are copied automatically when both the parent and child entity in the relationship are included in the copy selection set.

If you copy a view, the base tables (from which the view derives) are also copied.


Using the Copy Dialog

You can use the controls on the Copy dialog to copy a picture of the model to the Windows clipboard, or copy model objects to the same model or a different model. When you choose Copy (CTRL-C) on the Edit menu, ERwin displays the Copy dialog.

The purpose of each control on the Copy dialog is explained below:

•	Model. Click this button to copy model objects and all related definition information to the ERwin internal clipboard. You can paste information on the clipboard into the same model or a different model using the Paste option on the Edit menu. ERwin copies all selected objects in the diagram, as well as any identifying, non-identifying, or recursive relationships connecting them. ERwin does not copy the relationships between selected and non-selected objects.

•	Picture. Click this button to copy a picture of the contents of the ERwin diagram window to the Windows clipboard.

•	Metafile. Click this button if you want the picture to be in Windows metafile (.WMF) format.

•	Bitmap. Click this button if you want the picture to be in bitmap (.BMP) format.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Hint:	Cut or copied objects remain in the clipboard even after you paste them into another location. This is convenient if you want to paste more than one copy. But, if you have a very large copy selection on the clipboard, it can take up too much memory. To free up memory, after you finish copying and pasting, choose a simple, single entity and copy it to the clipboard to replace the large copy set.

Related Topics

  To copy diagram objects to a different diagram

  To copy diagram objects as a picture

  Selecting Multiple Diagram Objects

  How Copying Affects Foreign Keys and Relationships


To copy diagram objects as a picture

1.	Open the diagram you want to copy.

2.	Scroll or resize the diagram to display the objects you want to copy in the diagram window.

3.	Click Copy on the Edit menu or press CTRL+C.

4.	Click Picture.

5.	Choose one of the following options:

•	To copy the diagram in bitmap format, click Bitmap.

•	To copy the diagram as a Windows metafile, click Metafile.

6.	Click OK.

Note:	ERwin copies the diagram image to the Windows clipboard as a bitmap or Windows metafile format image. You can then paste the diagram into a word processing document or other file that supports this file format.


How Copying Affects Foreign Keys and Relationships

When you copy two or more entities or tables, any relationships between them are automatically copied, as are the foreign keys that are migrated through these relationships.

However, if you copy only one entity or table in a relationship, ERwin does not copy the relationship. As a result, foreign key attributes or columns become “orphaned” and are included in the resulting entity or table as owned attributes. For example, if a child entity is copied but not its parent, foreign key attributes that migrated to the child through the relationship become owned attributes of the child entity.

If later you recreate the relationship and cause the same attributes or columns to migrate to the child entity or table as a foreign key, ERwin recognizes that the new FK attributes or columns and the “orphaned” ones match, and unifies them in the child object.

Related Topics

  Using Copy, Cut, and Paste


Pasting Diagram Objects

Any diagram object that you have cut or copied to the ERwin clipboard can be pasted back into an ERwin diagram. You can paste objects into:

•	The same diagram from which you copied or cut them.

•	A different diagram.

•	A new, empty diagram.

When you paste an object into a diagram, it is placed in the same physical location as it appeared in the original diagram. For example, this means that if you copy an entity that appeared in the bottom right corner of page 1 of a diagram, and paste it in a diagram in another ERwin window, it is placed in the bottom right corner of page 1 of that new diagram. If the bottom of page 1 is not visible in the new diagram, you cannot see the pasted entity until you scroll or change to a different Zoom level.

If you paste one or more entities, tables, text blocks, or views into an existing model, they may overlap other objects in that diagram. Because all objects pasted into a diagram are automatically selected, you can easily drag the pasted objects to a blank portion of the diagram.

If you copy or delete a view and subsequently paste that view into a diagram, ERwin pastes not only the view, but also all base tables associated with that view into the diagram. If the base tables already exist, ERwin unifies the base tables, so that the diagram only contains a single copy of each base table.

Note:	You cannot paste attributes or columns in a model unless you paste the associated entity, table, or view. However, you can delete, move, and copy attributes and columns independently of any entity, table, or view.

ERwin does not enforce unique naming when you paste an object. If you want all objects in your model to have unique names, you must change the names manually.

Related Topics

  To paste diagram objects into a diagram

  Moving Diagram Objects


To paste diagram objects into a diagram

1.	Copy the entities, tables, views, and/or text blocks to the ERwin clipboard. More>

OR

Cut the objects to the clipboard. More>

2.	Optionally, you can open a different diagram into which you want to paste the copied objects. You can use the New or Open option on the File menu to open a new or existing diagram.

3.	Click in the diagram into which you want to paste the copied objects.

4.	Select Paste Model on the Edit menu or press CTRL-V. ERwin pastes the diagram objects and all the data associated with them into the target diagram.

Note:	After you paste, sometimes the pasted objects do not appear in the visible area of your diagram. ERwin places a pasted object in the same physical location that it appeared in the original diagram. You can scroll through the diagram to find the pasted objects or use the Go To option on the Edit menu to locate them.

If you select the Picture option button on the Copy dialog, ERwin copies a bitmap or Windows metafile picture, similar to a screen capture, to the Windows clipboard. You cannot paste the resulting image into an ERwin diagram, but you can paste it into a word processor file or other electronic document.


Deleting Diagram Objects

ERwin provides two ways to delete selected objects from your diagram:

•	Press the DELETE key on the keyboard.

•	Click Cut <Object> (CTRL-X) on the Edit menu.

You can use either method to delete selected entities, attributes, tables, views, columns, relationships, or text blocks from your model.

The Cut <Object> menu option is “object sensitive,” meaning that the name of the option confirms the type of object you are about to delete. For example, if you select a relationship in your diagram, the Edit menu displays the menu option Cut Relationship. If you have multiple objects selected, the Edit menu displays the menu option Cut Selected Objects.

When you delete one or more diagram objects, ERwin displays a confirmation dialog that includes the following options:

•	Remove From Subject Area. Click this button if you want to remove the selected objects from the current subject area without deleting them from the model. This option is unavailable if you are in the Main Subject Area.

•	Delete From Model. Click this button if you want to delete the selected objects from the model.

•	Copy To Clipboard. Select this check box if you want the deleted objects to be copied to the clipboard.

If you choose to copy the deleted objects to the clipboard, you can then paste the contents of the clipboard in the same diagram or a different ERwin diagram.

Note:	You cannot delete FK attributes or columns from the child entity or table. If you want to remove foreign key attributes or columns, you can remove the migrated attribute or column from the parent’s primary key, remove the relationship that contributes the foreign key, or migrate a partial key. See Partial Key Migration for more information.

When you delete one or more entities, tables, or views, all relationships that exist between the deleted objects and the remaining objects in the diagram are also deleted.

Related Topics

  To delete one or more diagram objects

  To delete a relationship

  To delete an attribute or column in the Diagram window

  Copying Diagram Objects

  Pasting Diagram Objects

  How Deleting a Relationship Affects Foreign Keys


To delete one or more diagram objects

1.	Select the entities, tables, views, text blocks, and or relationships that you want to delete. More>

2.	Click Cut <diagram object> or Cut Selected Objects on the Edit menu. ERwin displays the Delete dialog, and prompts you to confirm the delete.

3.	Choose one of the following options:

•	To delete the objects, click Delete from Model and clear the Copy to Clipboard check box.

•	To cut the objects and copy them to the clipboard, click Delete from Model and select the Copy to Clipboard check box.

•	To delete the objects from the current subject area only, click Remove from Subject Area. This option is unavailable if you are in the Main Subject Area.

4.	Click Yes.

Note:	If any relationships exist between the entities, tables, or views that are copied to the clipboard, ERwin also copies the relationships. However, relationships between copied or deleted objects and other objects in the diagram are lost.


To delete a relationship

1.	Click on the relationship line that you want to delete.

2.	Click Cut Relationship on the Edit menu or press CTRL+X.

ERwin prompts you to confirm the delete.

3.	Click Yes.

Hint:	You can also delete the relationship line by selecting the line and then pressing the DELETE key. ERwin still prompts you to confirm the delete.

Note:	When you delete a relationship, the contributed foreign key attributes, foreign key columns, or view columns are automatically removed from the child entity, table, or view.


To delete an attribute or column in the Diagram window

1.	Select the attributes or columns you want to delete. More>

2.	Press the DELETE key. ERwin prompts you to confirm the delete.

3.	Click Yes.

Hint:	To delete a view column, you can also select it with the Attribute Manipulation Tool [image], drag it onto the diagram background, and drop it there. The view column is deleted from the view, but not from the base tables.


How Deleting a Relationship Affects Foreign Keys

Foreign key attributes and columns automatically migrate across relationships, and can be seen as soon as two entities or tables are connected. When you delete a relationship, the automatic migration is reversed, and the contributed foreign key is automatically removed from the child entity or table.


Selecting Multiple Diagram Objects

ERwin diagrams include a variety of objects, including entities, tables, views, relationships, and text blocks. If you want to move two related objects, such as a parent and child table, you can easily select both objects and then perform a single action to affect them both.

There are three ways to select multiple diagram objects in ERwin:

•	The Lasso Method. This method allows you to select multiple diagram objects at one time, and then cut, copy, or move them. The figure below shows a lasso around the MOVIE and MOVIE COPY entities in a diagram.

•	The CTRL-Click Method. In this method you build a set of diagram objects by holding the CTRL key down while clicking with the mouse on each of the objects that you want to have in the set. Each of the selected objects is highlighted.

•	Select All. You can easily select all objects in your diagram using the Select All option on the Edit menu.

The result of the multiple selection is indicated by reverse highlighting of the affected object names, as shown below.

SELECTED	NOT SELECTED

By combining the lasso and CTRL-click methods, you can build almost any selection set you would want. Once you have selected one or more objects, they stay selected until you deselect one or all of them.

To deselect one object, hold down the CTRL key and click the mouse on it. To deselect all of the selected objects, click anywhere in the background of the diagram. ERwin removes the highlight from an object when it is no longer selected.

Hint:	It may be helpful to zoom out in your diagram before you select objects. This way, you can see more of the diagram on the screen and can select objects located in different parts of the diagram. This makes it easier to select multiple objects and copy or move them to another position in the diagram.

Related Topics

  To select one or more diagram objects

  To add objects to an existing set of selected objects

  Selecting Multiple Attributes or Columns


To select one or more diagram objects

1.	Click [image].

2.	Choose one or more of the following options:

3.	To select a contiguous group of diagram objects using the lasso method:

•	Click on the diagram background just above and to the left of the uppermost diagram object that you want to select

•	While holding down the mouse button, drag the cursor over and down so that the lassoed area completely surrounds all objects that you want to select.

•	Release the mouse button. Any object that is not completely surrounded by the lasso is not selected.

4.	To select objects individually, press the CTRL key, then click on each object you want to select.

Hint:	You can create a group using both the lasso and CTRL-click selection methods. First, select a group of contiguous objects using the lasso method and then add additional entities to the group using CTRL-click.

Note:	Subtype relationship symbols are treated as unique diagram objects and must be selected in a lasso or selected individually in order to be included in a selection group.


To add objects to an existing set of selected objects

•	To add an attribute or column to a group of selected attributes or columns, click [image], press the CTRL key, then click on each additional attribute or column that you want to select into the group.

•	To add an entity, table, view, text block, or subtype relationship symbol to a group of selected objects, click [image], press the CTRL key, then click on each additional object that you want to select into the group.

Note:	Subtype relationship symbols are treated as unique diagram objects and must be selected in a lasso or selected individually in order to be included in a selection group.

For all relationships, ERwin automatically selects the relationship ONLY IF both the parent and child entity, table, or view in the relationship are also selected. You cannot copy and paste a relationship independently of its corresponding parent and child entities, tables, or views.


Selecting Multiple Attributes or Columns

You can use the Attribute Manipulation tool [image] to select one or more attributes in a single entity, or one or more columns in a single table or view. Using the tool you can select:

•	One attribute or column. Click on the attribute or column name to select it.

•	Multiple contiguous attributes or columns. Select the attribute or column at the beginning of the group, then hold down the SHIFT key and select the attribute or column at the end of the group.

•	Multiple non-contiguous attributes or columns. CTRL-click on each attribute or column that you want to select.

Note:	You can select multiple attributes or columns from a single entity, table, or view only.

Related Topics

  To select one or more attributes or columns


To select one or more attributes or columns

1.	Click [image].

2.	Choose one or more of the following options:

•	To select a single attribute or column, click on it.

•	To select a group of contiguous attributes or columns, select the attribute or column at the beginning of the group, then hold down the SHIFT key and select the attribute or column at the end of the group.

•	To select a non-contiguous group of attributes or columns, press the CTRL key then click on each attribute or column that you want to select into the group.

Hint:	You can create a group using both SHIFT-click and CTRL-click selection methods. First select a group of contiguous attributes or columns using SHIFT-click and then add additional attributes or columns to the group using CTRL-click.

Note:	 You can select multiple attributes or columns from a single entity, table, or view only.


Moving Diagram Objects

As you develop your diagram, you may find that you want to move a diagram object to a different location to shorten relationship lines or to group similar objects together. To move a single object, you can click on it and drag it to a new location in the diagram. If you want to move more than one diagram object, you can select them and then use drag-and-drop.

As you move entities, tables, views, or subtype symbols, the relationship lines attached to these objects are moved for you automatically by ERwin. You can adjust relationship lines independently of the source or destination objects, as well.

Related Topics

  To move one or more diagram objects

  Adjusting Relationship Lines


To move one or more diagram objects

1.	Select one or more objects. More>

2.	Click on any selected object in the group and drag the entire selection to its new location.

3.	Release the mouse button to drop the selection on the diagram.


Moving Attributes or Columns in a Diagram

With the Attribute Manipulation tool [image], you can select one or more attributes or columns and move or reposition them. Use SHIFT-click to select a contiguous group of attributes or columns and CTRL-click to select non-contiguous attributes or columns.

You can then move selected attributes or columns by:

•	Dragging the selection to a different position in the entity, table, or view.

•	Dragging the selection to a different entity or table.

When you move an attribute or column, ERwin displays an insertion bar tool [image] to show you where the attribute or column will be inserted. ERwin automatically transfers the source definition information (e.g., domain, definition, notes, datatype, etc.) to the new location when you drop the selection.

When moving an attribute or column, the following rules also apply:

•	You cannot move a foreign key to a different entity or table, or move a foreign key that is migrated through an identifying relationship out of the key area.

•	You can move a foreign key in the non-key area into the primary key area of the same entity or table, unless the foreign key is migrated through a recursive (fishhook) relationship.

•	If you move an attribute or column that is assigned to an alternate key (AK) or inversion entry (IE) key group within the same entity or table, it retains its AK or IE designation. If you move it to a different entity or table, the AK/IE designation is removed.

•	You cannot move or copy view columns to a different table or view.

Related Topics

  To move an attribute or column


To move an attribute or column

1.	Click [image].

2.	Click on an attribute or column to select it or use SHIFT-click or CTRL-click to select multiple attributes or columns.

3.	Choose one of the following options:

•	To move the attributes or columns to a different position, drag the selection up or down in the entity, table or view, and drop it at the new position.

•	To move the attributes or columns to a different entity or table, drag the selection to the entity or table and drop it there. ERwin moves the selection to the selected entity or table.

Note:	There are special considerations when you move view columns, attributes or columns that are members of a foreign key, alternate key, or inversion entry. See Moving Attributes or Columns in a Diagram for more information.


Adjusting the Size of Entities, Tables, and Views

By default, ERwin automatically adjusts the height and width of each entity, table, or view to show all of the attributes in an entity, all of the columns in a table, and the full names of all of the objects in the diagram.

Using the Resize Diagram Objects dialog, you can also specify an exact height, width, or both of an entity, table, or view in a diagram. When you choose Resize Diagram Objects on the Options menu, ERwin displays the Resize Diagram Objects dialog.

The purpose of each control in the Resize Diagram Objects dialog is explained below:

•	Width. Select the display width of object names.

•	Automatic. Click this button if you want ERwin to automatically display the complete name of each entity, attribute, table, and column on your diagram. You can enter up to 255 characters for each entity name.

•	Set Width. Click this button and type a number in the text box if you want to specify the exact number of characters displayed for each attribute or column name in your diagram.

•	Height. Select the number of attributes and columns that display in each entity, table, and view.

•	Automatic. Click this button if you want ERwin to automatically display all attributes or columns on your diagram.

•	Set Height. Click this button and type a number in the text box if you want to specify the exact number of attributes or columns that you want to display for each entity, table, and view in your diagram.

If you specify a custom height or width that is not large enough to display all of the attribute or column names completely, some of the diagram information will be hidden from view. You can view the hidden information in the related ERwin editor.

ERwin does not increase the height of an entity, table, or view if you specify a height that is greater than the number of attributes or columns in that object. However, ERwin always increases the width of entities, tables, and views to the specified width, even if this width exceeds the space required for attribute or column names. You can also change the number of attributes or columns displayed in the diagram using the Primary Key display level. See Primary Key Display Level (Logical) and Primary Key Display Level (Physical) for more information.

Note:	Depending on the Windows system font you have selected, the actual number of characters displayed on your diagram may differ from the number that you specified in the Resize Diagram Objects dialog.

Related Topics

  To specify height and/or width of entities, tables, and views


To specify height and/or width of entities, tables, and views

1.	Choose Resize Diagram Objects on the Option menu.

2.	Choose one or more of the following options:

•	To change the width, click the Set Width button and type a value in the text box (the absolute width of the entity, table, or view, in characters).

•	To change the height, click the Set Height button and type a value in the text box (the maximum number of attributes or columns you want to display in each entity, table, and view).

3.	Click OK.

Hint:	You can also change the number of attributes or columns displayed in the diagram using the Primary Key display level. See Primary Key Display Level (Logical) and Primary Key Display Level (Physical) for more information.


Aligning Diagram Objects Using the Layout Grid

If you want to align the entities, tables, and/or views in your diagram, you can work with the Layout Grid option turned on. To select the layout grid and specify grid size, choose Layout on the Option menu.

The purpose of each control on the Layout dialog is explained below:

•	Layout Grid. Select this check box if you want all new entities to automatically align with a layout grid. You can specify the granularity of the grid, the distance between the horizontal or vertical lines that comprise the grid, using the X and Y text boxes. The distance between grid lines is specified in pixels. Clear this check box if you do not want entities to align with the layout grid (default).

•	X. Type a numeric value to specify the distance between horizontal grid lines in the layout grid.

•	Y. Type a numeric value to specify the distance between vertical grid lines in the layout grid.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

•	Layout. Click this button if you want ERwin to layout your diagram automatically. See Letting ERwin Lay Out Your Diagram for more information.

After you set the granularity of the layout grid using the X and Y text boxes, ERwin forces all new entities, tables, and/or views that you add to your diagram to line up with the grid coordinates. New objects “snap” to the grid automatically.

Existing objects are not automatically aligned with the grid unless they are copied, pasted, or moved.

Related Topics

  To turn on the layout grid

  To turn off the layout grid


To turn on the layout grid

1.	Select Layout on the Option menu.

2.	Select the Layout Grid check box.

3.	Enter numerical values in the X and Y text boxes to specify the distance you want to appear between horizontal and vertical lines in the grid, respectively. Grid distance is measured in pixels.

4.	Click OK.


To turn off the layout grid

1.	Select Layout on the Option menu.

2.	Clear the Layout Grid check box.

3.	Click OK.


Adjusting Relationship Lines

When you move an entity or add a relationship in a diagram, ERwin automatically adjusts the relationship line so that it bends around other objects in the diagram. The portion line between each bend in a relationship line is called a segment. ERwin automatically draws a one- or two-segment line unless the entities or tables sharing the relationship are very closely aligned either horizontally or vertically.

ERwin automatically positions relationship lines on the diagram when you add a new line and when you move the source or destination of the relationship line. For example, when you move an entity, table, or view that has a relationship line attached to it, ERwin automatically adjusts the position of the relationship line to connect to the object in its new location.

ERwin also offers the following options for line positioning:

•	Manual positioning. If you do not like where a relationship bends, you can change the shape of the relation line by dragging each segment in the relationship line to a shape or position that looks better.

•	Automatic positioning of all lines. You can use the Relationship Auto Layout option in the relationship shortcut menu or Reset to Automatic options on the Preference dialog to automatically layout relationship lines in your diagram. See Using Automatic Layout Options for Relationships for more information.

•	Prohibiting manual positioning. You can prohibit manual layout of lines using the Allow Auto Layout Only option on the Preferences dialog. See Using Automatic Layout Options for Relationships for more information.

Related Topics

  To adjust a relationship line

  Specifying Common Properties for a Stored Display


To adjust a relationship line

1.	Click [image].

2.	Click on the relationship line to select it.

3.	Click on a line segment in the selected relationship and drag it to a new position. Horizontal lines can be dragged up or down; vertical lines can be dragged right or left.

Hint:	To align two vertical or horizontal segments of a single relationship line, drag one of the line segments until it connects with the other segment. ERwin unifies the segments into a single line.


Redrawing the Diagram

After you manually change the graphical layout of the diagram, you may notice that certain text blocks, relationship lines, or object outlines are not clearly shown on the screen. You can use the Redraw Diagram option on the Edit menu to refresh the screen and make the objects more clear. When you select this option, ERwin simply redraws the diagram images without altering the position or size of any object.

Related Topics

  To redraw the diagram


To redraw the diagram

•	Select Redraw Diagram on the Edit menu.


Letting ERwin Lay Out Your Diagram

ERwin can automatically lay out objects in a diagram to help you keep a data model organized while you work. For example, if you add tables to a diagrams using copy and paste, the resulting diagram can become disorganized or can include overlapping objects. When you click the Layout button on the Layout dialog, ERwin adjusts all objects in the current subject area to produce a more organized diagram.

ERwin adjusts the position of the objects based on their size at the time the option is selected. As a result, you should select the display level and the amount of information displayed in tables, entities, or views prior to choosing the automatic layout option.

Note:	You can let ERwin automatically layout all relationship lines in your diagram independently of the entities, tables, and views in the subject area. See Using Automatic Layout Options for Relationships for more information.

Related Topics

  To lay out your diagram automatically


To lay out your diagram automatically

1.	Select Layout on the Option menu.

2.	Click the Layout button. ERwin warns you that the automatic layout is irreversible and gives you the option to cancel the request.

3.	Click Yes.


Using Automatic Layout Options for Relationships

ERwin includes three options that let you automatically layout relationship lines in the current subject area. These options include:

•	Using the Relationship Auto Layout option on the relationship shortcut menu. When you choose this option, ERwin automatically adjusts the position of the selected relationship line.

•	Selecting the Reset to Automatic option in the Display Options tab of the Preference dialog. This option automatically resets the position of all relationships in your diagram to the default layout position.

•	Selecting the Allow Auto Layout Only option in the Display Options tab of the Preference dialog. This option also automatically resets the position of all relationships in your diagram to the default layout position. In addition, when you select the Allow Auto Layout Only check box in the Preferences dialog, ERwin prevents you from manually moving any relationship line in the diagram.

Related Topics

  To layout a single relationship line automatically

  To layout all relationship lines automatically

  To prohibit manual layout of relationship lines

  To allow manual layout of relationship lines


To layout a single relationship line automatically

1.	Right-click on the relationship line you want ERwin to layout.

2.	Select the Relationship Auto Layout option on the shortcut menu.


To layout all relationship lines automatically

1.	Select Preference on the Option menu.

2.	Click the Display Options tab.

3.	Click the Reset to Automatic button. ERwin asks you to confirm automatic layout all of the relationship lines in the diagram.

4.	Click Yes.

5.	Click OK.


To prohibit manual layout of relationship lines

1.	Select Preference on the Option menu.

2.	Click on the Display Options tab.

3.	Select the Allow Auto Layout Only check box in the Relationship Line Layout Options group box. ERwin asks you to confirm that you want it to automatically layout all of the relationship lines in the diagram.

4.	Click Yes.

5.	Click OK.


To allow manual layout of relationship lines

1.	Select Preference on the Option menu.

2.	Click on the Display Options tab.

3.	Clear the Allow Auto Layout Only check box in the Relationship Line Layout Options group box.

4.	Click OK.


Enhancing the Appearance of an ERwin Diagram

When you design an ERwin diagram, you can use ERwin's font and color features to enhance its appearance and make it easier to view and understand. For example, if you want to prepare a diagram for analysis and presentation, you might want to enlarge the font size for all entity names so that they are easier to read or change the color of all foreign keys to red, so that they are distinguishable from other attributes or columns.

You can change the default fonts and colors for:

•	All of the objects of a single type (for example, tables) in the active diagram.

•	All of the objects of a single type in the active subject area.

•	A single object or a group of selected objects.

•	New objects of a single type (for example, entities) in the active diagram.

When you add an object to a diagram, ERwin automatically assigns it a default font and color. If you want to customize the colors, you can assign a different default color scheme using the Default Font/Color Editor. You can also change the color or font of individual objects in your diagram using the <Object> Font/Color Editors for each object or the ERwin Font and Color Toolbar.

For some diagram objects, the color of the object is related to that of a different object. For example, a relationship line is always the same color as the relationship name. Also, you can choose to have some objects, such as foreign key attributes or columns, inherit their color from a parent object. In the case of foreign keys, the color is inherited from the primary key attribute or column in the parent entity or table. See Summary of Default Font and Color Settings for more information.

By default, all ERwin diagram objects appear in black and white. If you add color to objects in your diagram, you can print the resulting diagram to most standard printers. Color diagrams revert to the default settings when printed on a monochrome printer, but print in color (as you might expect) on color printers and plotters.

You might also want to add a text blocks to an ERwin diagram to identify or clarify model elements. Text blocks can include any text you choose, including diagram version numbers, notes, titles, and captions.

Related Topics

  Changing the Font and Color Using Shortcut Menu Options

  Using the ERwin Font and Color Toolbar

  Using Text Blocks

  Using Icons to Enhance a Logical Diagram

  Using Icons to Enhance a Physical Diagram


Summary of Default Font and Color Settings

ERwin diagram objects are classed by object group in the Default Font/Color Editor. Each group has a default font (if it contains text) and color, as shown in the table below:

Default Font and Color Settings

Object Group	Default Font	Default Text Color	Default Line Color	Default Fill Color
Entity/Table/View
Name	10 Point Arial	Black	N/A	N/A
Definition	10 Point Arial	Black	N/A	N/A
Line	N/A	N/A	Black	N/A
Fill	N/A	N/A	N/A	White
Attribute/Column
Owned	10 Point Arial	Black	N/A	N/A
Foreign Key	Inherited from related PK	Inherited from related PK	N/A	N/A
Relationship
Line	N/A	N/A	Inherited from parent entity, table, or view	N/A
Verb phrase	Inherited from parent entity, table, or view name	Inherited from parent entity, table, or view name	N/A	N/A
Subtype
Symbol	N/A	N/A	Inherited from parent entity, table, or view	White
Discriminator	Inherited from parent entity, table, or view name	Inherited from parent entity, table, or view name	N/A	N/A
Text Block Text	10 Point Arial	Black	N/A	N/A
Page Number	10 Point Arial	Black	N/A	N/A
Background	N/A	N/A	N/A	White
All Fonts	10 Point Arial	Black	N/A	N/A
N/A = Not applicable

Related Topics

  Using the Default Font/Color Editor

  Enhancing the Appearance of an ERwin Diagram


Using the Default Font/Color Editor

You use the Default Font/Color Editor to specify default fonts and colors for ERwin diagram objects. You can select an object group using the tabs in the Editor and use the controls to define the default font, font size, point size, outline color, and fill color for that object.

Based on the object group that you select, the name of the Default Font/Color Editor and various labels and controls change. For example, if you select the Subtype tab, the dialog name changes to Subtype Default Font/Color Editor. The Subtype tab lets you define font and color defaults for the subtype symbol and discriminator. If you select the Background Color tab, the dialog name changes to Background Default Color Editor. This tab lets you define a background color used throughout the diagram.

The Preview window in the Default Font/Color Editor lets you preview how the default font and color will look when applied to the objects in the current diagram. You can also resize and expand the Preview window to see more of the diagram.

The Default Font/Color Editor includes the following tabs:

•	All Fonts. Define the default font and color for all objects in an ERwin diagram except the background color, entity fill, and subtype fill.

•	Entity Name. Define the default font and color for entity, table, and view names.

•	Entity Definition. Define the default font and color for entity definitions, and table and view comments.

•	Relationship. Define the default font and color for relationships, including the relationship symbol and the verb phrase.

•	Subtype. Define the default font and color for subtypes, including the subtype symbol outline and the discriminator.

•	Text Block Text. Define the default font and color for text blocks.

•	Page Number. Define the default font and color for page numbers.

•	Owned Entity Attributes. Define the default font and color for attributes and columns, except those that are part of a foreign key.

•	Foreign Key. Define the default font and color for foreign key attributes and columns.

•	Background Color. Define the default background color for a diagram.

•	Entity Line. Define the default line color for entities, tables, and views in a diagram.

•	Entity Fill. Define the default fill color for entities, tables, and views in a diagram.

•	Subtype Fill. Define the default fill color for subtype symbols in a diagram.

Related Topics

  Enhancing the Appearance of an ERwin Diagram

  Summary of Default Font and Color Settings

  Changing the Font and Color Using Shortcut Menu Options

  Using the ERwin Font and Color Toolbar


Defining Default Fonts and Colors for Diagram Objects

You use the controls on the All Fonts tab of the Default Font/Color Editor To define the default font and color for all objects in an ERwin diagram. The default font is applied to all text in the diagram. The default color is applied to all text and all object outlines in the diagram.

The purpose of each control in the All Fonts tab is explained below:

•	Font. Displays the default font setting for all text objects in the current diagram. Select a different default font from the list provided.

•	Font Style. Displays the default font style, such as regular, bold, or italic, for all text objects in the current diagram. Select a different default font style from the list provided.

•	Size. Displays the default font size for all text objects in the current diagram. Select a different default font size from the list provided.

•	Color. Displays the default color for all text and object outlines in the current diagram. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to font and color in this tab apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Effects group box is explained below:

•	Strikeout. Select this check box to apply a strikethrough effect, such as this, to all text objects in the current diagram. Clear this check box to remove the strikethrough effect.

•	Underline. Select this check box to apply underline to all text objects in the current diagram. Clear this check box to remove the underline.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default font and color settings to new objects that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default font and color settings to new objects that you add to the diagram and existing objects in the current subject area.

•	All Objects. Click this button to apply the default font and color to all objects in the diagram and any new objects that you add to the diagram.

Related Topics

  To define the default fonts and colors for diagram objects

  Using the Default Font/Color Editor


To define the default fonts and colors for diagram objects

1.	Choose Default Font/Color on the Option menu.

2.	Click the All Fonts tab.

3.	Choose one of the following options:

•	To apply your changes to new objects only, click the New Objects Only button.

•	To apply your changes to all objects in the current subject area and all new objects, click the Current Object Pool button.

•	To apply your changes to the entire diagram, click the All Objects button.

4.	Choose one or more of the following options:

•	To change the font characteristic for text objects, select a different setting in the Font, Font Style, or Size list.

•	To change the color of object outlines and text objects, select a different color in the Color list.

•	To apply special text effects, click the Strikeout or Underline buttons.

5.	Click OK.

Note:	You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining Default Font and Color for Entity, Table, and View Names

You use the controls on the Entity Name tab of the Default Font/Color Editor to define the default font and color for entity, table, and view names in an ERwin diagram.

The purpose of each control in the Entity Name tab is explained below:

•	Entity Font. Displays the default font setting for entity, table, and view names. Select a different default font from the list provided.

•	Font Style. Displays the default font style, such as regular, bold, or italic, for entity, table, and view names. Select a different default font style from the list provided.

•	Size. Displays the default font size for entity, table, and view names. Select a different default font size from the list provided.

•	Entity Color. Displays the default color for entity, table, and view names. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to font and color in this tab apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Effects group box is explained below:

•	Strikeout. Select this check box to apply a strikethrough effect, such as this, to entity, table, and view names. Clear this check box to remove the strikethrough effect.

•	Underline. Select this check box to apply underline to entity, table, and view names. Clear this check box to remove the underline.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default font and color settings to new entity, table, and view names that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default font and color settings to new entity, table, and view names that you add to the diagram and existing entity, table, and view names in the current subject area.

•	All Objects. Click this button to apply the default font and color to all entity, table, and view names in the diagram and any new entity, table, and view names that you add to the diagram.

Related Topics

  To define the default font and color for entity, table, and view names

  Using the Default Font/Color Editor


To define the default font and color for entity, table, and view names

1.	Choose Default Font/Color on the Option menu.

2.	Click the Entity Name tab.

3.	Choose one of the following options:

•	To apply your changes to new entity, table, and view names only, click the New Objects Only button.

•	To apply your changes to all entity, table, and view names in the current subject area and all new entity, table, and view names, click the Current Object Pool button.

•	To apply your changes to all entity, table, and view names in the entire diagram, click the All Objects button.

4.	Choose one or more of the following options:

•	To change the font characteristic for entity, table, and view names, select a different setting in the Font, Font Style, or Size list.

•	To change the color of entity, table, and view names, select a different color in the Color list.

•	To apply special text effects, click the Strikeout or Underline buttons.

5.	Click OK.

Note:	You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining Default Font and Color for Definitions and Comments

You use the controls on the Entity Definition tab of the Default Font/Color Editor To define the default font and color for entity definitions, and table and view comments in an ERwin diagram.

The purpose of each control in the Entity Definition tab is explained below:

•	Definition Font. Displays the default font setting for entity definitions, and table and view comments. Select a different default font from the list provided.

•	Font Style. Displays the default font style, such as regular, bold, or italic, for entity definitions, and table and view comments. Select a different default font style from the list provided.

•	Size. Displays the default font size for entity definitions, and table and view comments. Select a different default font size from the list provided.

•	Definition Color. Displays the default color for entity definitions, and table and view comments. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to font and color in this tab apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Effects group box is explained below:

•	Strikeout. Select this check box to apply a strikethrough effect, such as this, to entity definitions, and table and view comments. Clear this check box to remove the strikethrough effect.

•	Underline. Select this check box to apply underline to entity definitions, and table and view comments. Clear this check box to remove the underline.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default font and color settings to new entity definitions, and table and view comments that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default font and color settings to new entity definitions, and table and view comments that you add to the diagram and existing entity definitions, and table and view comments in the current subject area.

•	All Objects. Click this button to apply the default font and color to all entity definitions, and table and view comments in the diagram and any new entity definitions, and table and view comments that you add to the diagram.

Related Topics

  To define the default font and color for definitions and comments

  Using the Default Font/Color Editor


To define the default font and color for definitions and comments

1.	Choose Default Font/Color on the Option menu.

2.	Click the Entity Definition tab.

3.	Choose one of the following options:

•	To apply your changes to new entity definitions, and table and view comments only, click the New Objects Only button.

•	To apply your changes to all definitions and comments in the current subject area and all new entity definitions, and table and view comments, click the Current Object Pool button.

•	To apply your changes to all entity definitions, and table and view comments in the entire diagram, click the All Objects button.

4.	Choose one or more of the following options:

•	To change the font characteristic for entity definitions, and table and view comments, select a different setting in the Font, Font Style, or Size list.

•	To change the color of entity definitions, and table and view comments, select a different color in the Color list.

•	To apply special text effects, click the Strikeout or Underline buttons.

5.	Click OK.

Note:	You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining Default Font and Color for Relationships

You use the controls on the Relationship tab of the Default Font/Color Editor To define the default font and color for relationships in an ERwin diagram. The defaults apply to the relationship symbol and the verb phrase.

The purpose of each control in the Relationship tab is explained below:

•	Relationship Font. Displays the default font setting for relationship names. Select a different default font from the list provided. This list includes the option Inherit Parent, which means that all font, font style, size, and font effects information is inherited from the parent entity, table, or view.

•	Font Style. Displays the default font style, such as regular, bold, or italic, for relationship names. Select a different default font style from the list provided. This control is not displayed if the selected Relationship Font is “Inherit Parent”.

•	Size. Displays the default font size for relationship names. Select a different default font size from the list provided. This control is not displayed if the selected Relationship Font is “Inherit Parent”.

•	Relationship Color. Displays the default color for relationship names and lines. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to font and color in this tab apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Effects group box is explained below:

•	Strikeout. Select this check box to apply a strikethrough effect, such as this, to relationship names. Clear this check box to remove the strikethrough effect. This control is not displayed if the selected Relationship Font is “Inherit Parent”.

•	Underline. Select this check box to apply underline to relationship names. Clear this check box to remove the underline. This control is not displayed if the selected Relationship Font is “Inherit Parent”.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default font and color settings to new relationship names and lines that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default font and color settings to new relationship names and lines that you add to the diagram and existing relationship names and lines in the current subject area.

•	All Objects. Click this button to apply the default font and color to all relationship names and lines in the diagram and any new relationship names and lines that you add to the diagram.

Related Topics

  To define the default font and color for relationships

  Using the Default Font/Color Editor


To define the default font and color for relationships

1.	Choose Default Font/Color on the Option menu.

2.	Click the Relationship tab.

3.	Choose one of the following options:

•	To apply your changes to new relationship names and lines only, click the New Objects Only button.

•	To apply your changes to all relationship names and lines in the current subject area and all new relationship names and lines, click the Current Object Pool button.

•	To apply your changes to all relationship names and lines in the entire diagram, click the All Objects button.

4.	Choose one or more of the following options:

•	To change the font characteristic for relationship names, select a different setting in the Font, Font Style, or Size list.

•	To change the color of relationship names and lines, select a different color in the Color list.

•	To apply special text effects, click the Strikeout or Underline buttons.

5.	Click OK.

Note:	The Relationship Font list includes the option Inherit Parent, which means that all font, font style, size, and font effects information is inherited from the parent entity, table, or view. When you select this option, ERwin hides the Font Style, Size, Strikeout, and Underline controls.

You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining Default Font and Color for Subtypes

You use the controls on the Subtype tab of the Default Font/Color Editor To define the default font and color for subtype symbols and discriminators in an ERwin diagram.

The purpose of each control in the Subtype tab is explained below:

•	Subtype Font. Displays the default font setting for subtype discriminators. Select a different default font from the list provided. This list includes the option Inherit Parent, which means that all font, font style, size, and font effects information is inherited from the supertype entity.

•	Font Style. Displays the default font style, such as regular, bold, or italic, for subtype discriminators. Select a different default font style from the list provided. This control is not displayed if the selected Subtype Font is “Inherit Parent”.

•	Size. Displays the default font size for subtype discriminators. Select a different default font size from the list provided. This control is not displayed if the selected Subtype Font is “Inherit Parent”.

•	Subtype Color. Displays the default color for subtype discriminators and symbols. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to font and color in this tab apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Effects group box is explained below:

•	Strikeout. Select this check box to apply a strikethrough effect, such as this, to subtype discriminators. Clear this check box to remove the strikethrough effect. This control is not displayed if the selected Subtype Font is “Inherit Parent”.

•	Underline. Select this check box to apply underline to subtype discriminators. Clear this check box to remove the underline. This control is not displayed if the selected Subtype Font is “Inherit Parent”.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default font and color settings to new subtype discriminators and symbols that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default font and color settings to new subtype discriminators and symbols that you add to the diagram and existing subtype discriminators and symbols in the current subject area.

•	All Objects. Click this button to apply the default font and color to all subtype discriminators and symbols in the diagram and any new subtype discriminators and symbols that you add to the diagram.

Related Topics

  To define the default font and color for subtypes

  Using the Default Font/Color Editor

  Defining the Default Fill Color for Subtypes Symbols


To define the default font and color for subtypes

1.	Choose Default Font/Color on the Option menu.

2.	Click the Subtype tab.

3.	Choose one of the following options:

•	To apply your changes to new subtype symbols and discriminators only, click the New Objects Only button.

•	To apply your changes to all subtype symbols and discriminators in the current subject area and all new subtype symbols and discriminators, click the Current Object Pool button.

•	To apply your changes to all subtype symbols and discriminators in the entire diagram, click the All Objects button.

4.	Choose one or more of the following options:

•	To change the font characteristic for subtype discriminators, select a different setting in the Font, Font Style, or Size list.

•	To change the color of subtype symbols and discriminators, select a different color in the Color list.

•	To apply special text effects, click the Strikeout or Underline buttons.

5.	Click OK.

Note:	The Subtype Font list includes the option Inherit Parent, which means that all font, font style, size, and font effects information is inherited from the supertype entity. When you select this option, ERwin hides the Font Style, Size, Strikeout, and Underline controls.

You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining Default Font and Color for Text Blocks

You use the controls on the Text Block Text tab of the Default Font/Color Editor To define the default font and color for text blocks in an ERwin diagram.

The purpose of each control in the Text Block Text tab is explained below:

•	Text Block Font. Displays the default font setting for text blocks. Select a different default font from the list provided.

•	Font Style. Displays the default font style, such as regular, bold, or italic, for text blocks. Select a different default font style from the list provided.

•	Size. Displays the default font size for text blocks. Select a different default font size from the list provided.

•	Text Block Color. Displays the default color for text in text blocks. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to font and color in this tab apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Effects group box is explained below:

•	Strikeout. Select this check box to apply a strikethrough effect, such as this, to text blocks. Clear this check box to remove the strikethrough effect.

•	Underline. Select this check box to apply underline to text blocks. Clear this check box to remove the underline.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default font and color settings to new text blocks that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default font and color settings to new text blocks that you add to the diagram and existing text blocks in the current subject area.

•	All Objects. Click this button to apply the default font and color to all text blocks in the diagram and any new text blocks that you add to the diagram.

Related Topics

  To define the default font and color for text blocks

  Using the Default Font/Color Editor

  Using Text Blocks


To define the default font and color for text blocks

1.	Choose Default Font/Color on the Option menu.

2.	Click the Text Block Text tab.

3.	Choose one of the following options:

•	To apply your changes to new text blocks only, click the New Objects Only button.

•	To apply your changes to all text blocks in the current subject area and all new text blocks, click the Current Object Pool button.

•	To apply your changes to all text blocks in the entire diagram, click the All Objects button.

4.	Choose one or more of the following options:

•	To change the font characteristic for text blocks, select a different setting in the Font, Font Style, or Size list.

•	To change the color of text in text blocks, select a different color in the Color list.

•	To apply special text effects, click the Strikeout or Underline buttons.

5.	Click OK.

Note:	You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining Default Font and Color for Page Numbers

You use the controls on the Page Number tab of the Default Font/Color Editor To define the default font and color for page numbers in a printed ERwin diagram.

The purpose of each control in the Page Number tab is explained below:

•	Page Number Font. Displays the default font setting for page numbers. Select a different default font from the list provided.

•	Font Style. Displays the default font style, such as regular, bold, or italic, for page numbers. Select a different default font style from the list provided.

•	Size. Displays the default font size for page numbers. Select a different default font size from the list provided.

•	Page Number Color. Displays the default color for page numbers. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to font and color in this tab apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Effects group box is explained below:

•	Strikeout. Select this check box to apply a strikethrough effect, such as this, to page numbers. Clear this check box to remove the strikethrough effect.

•	Underline. Select this check box to apply underline to page numbers. Clear this check box to remove the underline.

Related Topics

  To define the default font and color for page numbers

  Using the Default Font/Color Editor


To define the default font and color for page numbers

1.	Choose Default Font/Color on the Option menu.

2.	Click the Page Number tab.

3.	Choose one or more of the following options:

•	To change the font characteristic for page numbers, select a different setting in the Font, Font Style, or Size list.

•	To change the color of text in page numbers, select a different color in the Color list.

•	To apply special text effects, click the Strikeout or Underline buttons.

4.	Click OK.


Defining Default Font and Color for Owned Attributes and Columns

You use the controls on the Owned Entity Attribute tab of the Default Font/Color Editor To define the default font and color for attributes and columns in an ERwin diagram. The defaults apply to owned attributes, that is, all attributes and columns except those that are part of a foreign key.

The purpose of each control in the Owned Entity Attribute tab is explained below:

•	Owned Entity Attrib (font). Displays the default font setting for owned attributes and columns. Select a different default font from the list provided.

•	Font Style. Displays the default font style, such as regular, bold, or italic, for owned attributes and columns. Select a different default font style from the list provided.

•	Size. Displays the default font size for owned attributes and columns. Select a different default font size from the list provided.

•	Owned Entity Attrib (color). Displays the default color for owned attributes and columns. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to font and color in this tab apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Effects group box is explained below:

•	Strikeout. Select this check box to apply a strikethrough effect, such as this, to owned attributes and columns. Clear this check box to remove the strikethrough effect.

•	Underline. Select this check box to apply underline to owned attributes and columns. Clear this check box to remove the underline.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default font and color settings to new owned attributes and columns that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default font and color settings to new owned attributes and columns that you add to the diagram and existing owned attributes and columns in the current subject area.

•	All Objects. Click this button to apply the default font and color to all owned attributes and columns in the diagram and any new owned attributes and columns that you add to the diagram.

Related Topics

  To define the default font and color for owned attributes and columns

  Using the Default Font/Color Editor


To define the default font and color for owned attributes and columns

1.	Choose Default Font/Color on the Option menu.

2.	Click the Owned Entity Attribute tab.

3.	Choose one of the following options:

•	To apply your changes to new owned attributes and columns only, click the New Objects Only button.

•	To apply your changes to all owned attributes and columns in the current subject area and all new owned attributes and columns, click the Current Object Pool button.

•	To apply your changes to all owned attributes and columns in the entire diagram, click the All Objects button.

4.	Choose one or more of the following options:

•	To change the font characteristic for owned attributes and columns, select a different setting in the Font, Font Style, or Size list.

•	To change the color of owned attributes and columns, select a different color in the Color list.

•	To apply special text effects, click the Strikeout or Underline buttons.

5.	Click OK.

Note:	You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining Default Font and Color for Foreign Keys

You use the controls on the Foreign Key tab of the Default Font/Color Editor To define the default font and color for foreign keys in an ERwin diagram.

The purpose of each control in the Foreign Key tab is explained below:

•	FK Entity Attribute (font). Displays the default font setting for foreign keys. Select a different default font from the list provided. This list includes the option Inherit Parent, which means that all font, font style, size, and font effects information is inherited from the migrated primary key.

•	Font Style. Displays the default font style, such as regular, bold, or italic, for foreign keys. Select a different default font style from the list provided. This control is not displayed if the selected FK Entity Attribute is “Inherit Parent”.

•	Size. Displays the default font size for foreign keys. Select a different default font size from the list provided. This control is not displayed if the selected FK Entity Attribute is “Inherit Parent”.

•	FK Entity Attribute (color). Displays the default color for foreign keys. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to font and color in this tab apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Effects group box is explained below:

•	Strikeout. Select this check box to apply a strikethrough effect, such as this, to foreign keys. Clear this check box to remove the strikethrough effect. This control is not displayed if the selected FK Entity Attribute is “Inherit Parent”.

•	Underline. Select this check box to apply underline to foreign keys. Clear this check box to remove the underline. This control is not displayed if the selected FK Entity Attribute is “Inherit Parent”.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default font and color settings to new foreign keys that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default font and color settings to new foreign keys that you add to the diagram and existing foreign keys in the current subject area.

•	All Objects. Click this button to apply the default font and color to all foreign keys in the diagram and any new foreign keys that you add to the diagram.

Related Topics

  To define the default fonts and colors for foreign keys

  Using the Default Font/Color Editor


To define the default font and color for foreign keys

1.	Choose Default Font/Color on the Option menu.

2.	Click the Foreign Key tab.

3.	Choose one of the following options:

•	To apply your changes to new foreign keys only, click the New Objects Only button.

•	To apply your changes to all foreign keys in the current subject area and all new foreign keys, click the Current Object Pool button.

•	To apply your changes to all foreign keys in the entire diagram, click the All Objects button.

4.	Choose one or more of the following options:

•	To change the font characteristic for foreign keys, select a different setting in the Font, Font Style, or Size list.

•	To change the color of foreign keys, select a different color in the Color list.

•	To apply special text effects, click the Strikeout or Underline buttons.

5.	Click OK.

Note:	The FK Entity Attribute list includes the option Inherit Parent, which means that all font, font style, size, and font effects information is inherited from the migrated primary key. When you select this option, ERwin hides the Font Style, Size, Strikeout, and Underline controls.

You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining the Default Background Color for a Diagram

You use the controls on the Background Color tab of the Default Font/Color Editor To define the default background color for an ERwin diagram.

The purpose of each control in the Background Color tab is explained below:

•	Background Color. Displays the default color for the diagram background. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to the background color apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To define the default background color for a diagram

  Using the Default Font/Color Editor


To define the default background color for a diagram

1.	Choose Default Font/Color on the Option menu.

2.	Click the Background Color tab.

3.	Select a different color in the Background Color list.

4.	Click OK.


Defining the Default Entity, Table, and View Line Color

You use the controls on the Entity Line tab of the Default Font/Color Editor to define the default line color for the entities in an ERwin diagram.

The purpose of each control in the Entity Line tab is explained below:

•	Entity Line Color. Displays the default color for entity, table, and view outlines. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to entity line color apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default outline color settings to new entities, tables, and views that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default outline color settings to new entities, tables, and views that you add to the diagram and existing entities, tables, and views in the current subject area.

•	All Objects. Click this button to apply the default outline color to all entities, tables, and views in the diagram and any new entities, tables, and views that you add to the diagram.

Related Topics

  To define the default entity, table, and view line color

  Using the Default Font/Color Editor


To define the default entity, table, and view line color

1.	Choose Default Font/Color on the Option menu.

2.	Click the Entity Line tab.

3.	Choose one of the following options:

•	To apply your changes to new entities, tables, and views only, click the New Objects Only button.

•	To apply your changes to all entities, tables, and views in the current subject area and all new entities, tables, and views, click the Current Object Pool button.

•	To apply your changes to all entities, tables, and views in the entire diagram, click the All Objects button.

4.	Select a different color in the Entity Line Color list.

5.	Click OK.

Note:	You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining the Default Fill Color for Entities, Tables, and Views

You use the controls on the Entity Fill tab of the Default Font/Color Editor to define the default fill color for the entities, tables, and views in an ERwin diagram.

The purpose of each control in the Entity Fill tab is explained below:

•	Entity Fill Color. Displays the default fill color for entities, tables, and views. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to entity, table, and view fill color apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default fill color settings to new entities, tables, and views that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default fill color settings to new entities, tables, and views that you add to the diagram and existing entities, tables, and views in the current subject area.

•	All Objects. Click this button to apply the default fill color to all entities, tables, and views in the diagram and any new entities, tables, and views that you add to the diagram.

Related Topics

  To define the default fill color for entities, tables, and views

  Using the Default Font/Color Editor


To define the default fill color for entities, tables, and views

1.	Choose Default Font/Color on the Option menu.

2.	Click the Entity Fill tab.

3.	Choose one of the following options:

•	To apply your changes to new entities, tables, and views only, click the New Objects Only button.

•	To apply your changes to all entities, tables, and views in the current subject area and all new entities, tables, and views, click the Current Object Pool button.

•	To apply your changes to all entities, tables, and views in the entire diagram, click the All Objects button.

4.	Select a different color in the Entity Fill Color list.

5.	Click OK.

Note:	You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Defining the Default Fill Color for Subtypes Symbols
Defining the Default Fill Color for Subtypes in a Diagram

You use the controls on the Subtype Fill tab of the Default Font/Color Editor to define the default fill color for subtype symbols in an ERwin diagram.

The purpose of each control in the Subtype Fill tab is explained below:

•	Subtype Fill Color. Displays the default fill color for subtype symbols. Select a different default color from the list provided.

•	Preview window. Displays a portion of your diagram and lets you see how the changes you make to subtype fill color apply to the current diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The purpose of each control in the Apply Settings To group box is explained below:

•	New Objects Only. Click this button to apply the default fill color settings to new subtypes that you add to the diagram. Existing objects are not changed.

•	Current Object Pool. Click this button to apply the default fill color settings to new subtypes that you add to the diagram and existing subtypes in the current subject area.

•	All Objects. Click this button to apply the default fill color to all subtypes in the diagram and any new subtypes that you add to the diagram.

Related Topics

  To define the default fill color for subtype symbols

  Using the Default Font/Color Editor

  Defining Default Font and Color for Subtypes


To define the default fill color for subtype symbols

1.	Choose Default Font/Color on the Option menu.

2.	Click the Subtype Fill tab.

3.	Choose one of the following options:

•	To apply your changes to new subtype symbols only, click the New Objects Only button.

•	To apply your changes to all subtype symbols in the current subject area and all new subtype symbols, click the Current Object Pool button.

•	To apply your changes to all subtype symbols in the entire diagram, click the All Objects button.

4.	Select a different color in the Subtype Fill Color list.

5.	Click OK.

Note:	You must choose the objects to which you want to apply the settings before you change any settings in this Editor.


Changing the Font and Color Using Shortcut Menu Options

The Object Font/Color options on the ERwin shortcut menus open a smaller, object-specific version of the Default Font/Color Editor.

The purpose of each control on the <Object> Font/Color Editor is explained below:

•	Entity. Select a different entity from the list provided to change the color or font for that entity, the corresponding table in the physical model, and all objects that inherit their color from that entity.

The <Object> Font/Color Editor contains three tabs, as listed below. Not all tabs are available for the selected ERwin object. Click on the tab name to get help for the controls on that tab.

•	Text

•	Fill

•	Entity Outline

Note:	When you choose the Object Font/Color option on the diagram shortcut menu, ERwin opens the Default Font/Color Editor with the diagram Background tab displayed. See Using the Default Font/Color Editor for more information.

Related Topics

  To change the font and color settings for one or more diagram objects

  To change the diagram background color

  Using the ERwin Font and Color Toolbar


To change the font and color settings for one or more diagram objects

1.	Right-click on an object, then choose Object Font/Color on the shortcut menu.

2.	Choose one or more of the following options:

•	To change the text settings, if applicable, click the Text tab.

•	To change the fill color settings, if applicable, click the Fill tab.

•	To change the outline color settings, if applicable, click the Entity Outline tab.

3.	Click OK.

Note:	If you want to change the font or color of a different object while you are in the <Object> Font/Color Editor, you can select another object in the Preview window and change the settings, or choose a different entity name from the Entity list.

If you want to change the font or color of multiple objects, select the objects in your diagram, then right-click on one of the selected objects, choose Object Font/Color on the shortcut menu, and make the required font and/or color changes. See Selecting Multiple Diagram Objects for more information.


To change the diagram background color

1.	Right-click on a blank area in the diagram, then choose Diagram Fonts/Color on the shortcut menu.

2.	Change the background color for the diagram in the Background Color list.

3.	Click OK.


Using the ERwin Font and Color Toolbar

You can use the ERwin Font and Color Toolbar to quickly change the font and color of the objects in an ERwin diagram. The Font and Color toolbar includes a list of all fonts that are available on your system and has separate controls to modify the text color, object fill color, and entity outline color.

Related Topics

  ERwin Font and Color Toolbar

  To change an object's font and color settings using the Font and Color Toolbar


To change an object's font and color settings using the Font and Color Toolbar

1.	If the Font and Color Toolbar is hidden, click the Font & Color Toolbar option on the Window menu to display it.

2.	Click [image] or [image] in the ERwin toolbox.

3.	Select one or more objects for which you want to change the font and color settings. More>

4.	Choose any of the following options:


Using Text Blocks

You might also want to add a text blocks to an ERwin diagram to identify or clarify model elements. Text blocks can include any text you choose, including diagram version numbers, notes, titles, and captions.

You can create a text block using the Text Block tool  [image] in the ERwin toolbox. When you select the tool and click on the diagram background, ERwin adds a new text block and enables text editing, so you can type the text directly onto the diagram.

Any available keyboard character can be used in a text block. You can create line breaks using the ENTER key. You cannot, however, include tabs.

You can edit this text block using the Text Block Editor, which you can access by right-clicking on the text block and choosing the Text Block Editor option on the shortcut menu.

If you add a text block to your diagram but do not type any text, ERwin displays the empty text block as an asterisk ( [image]) on your diagram. You can select the empty text block and delete it or add text to it exactly the same as you would any other ERwin text block.

Related Topics

  To create a text block

  To move a text block

  To edit a text block

  To delete a text block

  Defining Default Font and Color for Text Blocks

  Changing the Font and Color Using Shortcut Menu Options


To create a text block

1.	Click [image] in the ERwin toolbox.

2.	Click on the diagram at the position you want the text block to appear.

3.	Type the text that you want to add to your diagram. You can press the ENTER key to include line breaks in the text, however the TAB key is not supported.

4.	Press SHIFT+ENTER or click on your diagram outside of the text block to close the text block and save your changes in the diagram.


To move a text block

•	Select the text block and drag it to a new position in your diagram.


To edit a text block

1.	Right-click on the text block that you want to edit, then click Text Block Editor on the shortcut menu.

2.	Edit the text in the text window.

3.	Click OK.

Note:	You can also use on-diagram editing change the text in a text block. To edit the text, click on it, wait a moment, then click again. ERwin opens an editing window and lets you make changes to the text. Click SHIFT+ENTER to close the editing window.


To delete a text block

1.	Select the text block you want to delete.

2.	Press the DELETE key. ERwin prompts you to delete the text block.

3.	If you want to copy the text block to the Clipboard, select the Copy to Clipboard check box.

4.	Click Yes.

Note:	If you copy a text block to the Clipboard, you can paste it back into your diagram using the Paste Model option on the Edit menu. The pasted text appears in the same relative location in the diagram from which it was deleted.


Creating a New Object Using the Edit Menu

The Create New <Object> option on the Edit menu lets you quickly create a new object for the currently selected object tool. For example, if you select the Entity tool, the next time you want to add an entity to the diagram you can choose the Create New Entity option on the Edit menu.

ERwin changes the cursor to the entity shape. When you click the mouse, ERwin places an entity object in the cursor position in the diagram.

Note: 	The Create New <Object> menu option is unavailable (dimmed) when the Selection or Attribute Manipulation tool is currently selected.

The Create New Relationship option creates a recursive (fishhook) relationship for the selected entity or table.

Related Topics

  Creating a Table

  Creating a View

  Creating an Entity


Using Icons to Enhance a Logical Diagram

With ERwin 3.5 you can assign meaningful icons to enhance the appearance of logical model diagram objects. You can use icons to represent entities, attributes, attribute domains, and primary keys. You can use ERwin’s default icons, or use the Icon Editor to import your own bitmaps.

You can use the diagram shortcut menu to toggle the following logical object icons on or off:

•	Entity Icon Display Option

•	Logical Primary Key Designator Display Option

•	Attribute Icon Display Option

•	Logical Datatype/Domain Display Option

Related Topics

  Using Icons to Enhance a Physical Diagram

  Summary of Default Icons

  Icon Display Level

  Using the ERwin Icon Editor

  Logical Alternate Key Designator Display Option

  Logical Foreign Key Designator Display Option


Using Icons to Enhance a Physical Diagram

With ERwin 3.5 you can assign meaningful icons to enhance the appearance of physical and dimensional model diagram objects. In physical model diagrams, you can use the primary key icon to represent primary keys. When you select DM (Dimensional Modeling) notation for your physical model, you can use the dimensional modeling role icons to identify the dimensional tables roles. Unlike the icons used in logical model diagrams, these icons are fixed and cannot be changed.

You can use the diagram shortcut menu to toggle the following physical object icons on or off:

•	Physical Primary Key Designator Display Option

•	Dimensional Icon Display Option

Related Topics

  Using Icons to Enhance a Logical Diagram

  Summary of Default Icons

  Physical Alternate Key Designator Display Option

  Physical Foreign Key Designator Display Option

  Specifying Dimensional Modeling Table Options


Summary of Default Icons

The table below lists the default icons you can use to represent specific ERwin objects.

Model Type	Model Object	Icon	Description / Note
Logical	Entity		Default Entity icon. Changeable in the Entity Editor for small and large icons.
	Attribute		Default <unknown> Icon. Changeable in the Domain Dictionary Editor and the Attribute Editor.
			Default Blob icon. Changeable in the Domain Dictionary Editor and the Attribute Editor.
			Default Datetime icon. Changeable in the Domain Dictionary Editor and the Attribute Editor.
			Default Number icon. Changeable in the Domain Dictionary Editor and the Attribute Editor.
			Default String icon. Changeable in the Domain Dictionary Editor and the Attribute Editor.
	Primary Key		Default Primary key icon. You cannot change this assigned icon.
Physical	Primary Key		Default Primary key icon. You cannot change this assigned icon.
Dimensional	Role		Fact table. You cannot change this assigned icon.
			Dimension table. You cannot change this assigned icon.
			Outrigger table. You cannot change this assigned icon.
	Primary Key		Default Primary key icon. You cannot change this assigned icon.
Related Topics

  Icon Bitmaps Supplied with ERwin

  Using the ERwin Icon Editor

  Using Icons to Enhance a Physical Diagram

  Using Icons to Enhance a Logical Diagram


Using the ERwin Icon Editor

In the Icon tab of the ERwin Entity Editor, and the General tab of the Attribute Editor and Domain Dictionary Editor, you can click the Open Editor button [image] to open the ERwin Icon Editor. In the Icon Editor, you can import, rename and delete icon bitmaps. These internal bitmaps exist as icons within ERwin, and are separate from other bitmaps, including those installed by ERwin . Once imported, you can assign icons to logical model entities, attributes and domain icons in the respective entity, attribute and domain dictionary editors.

The purpose of each control on the ERwin Icon Editor is explained below:

•	Import. Click to open the ERwin Open File dialog and select a bitmap. When you click OK, the selected bitmap is imported into the Icon Editor and displays in the Icon Editor list. All imported icons except large entity icons, display in 16 x 16 pixel resolution. Imported large entity icons display in 32 x 32 pixel resolution.

•	Rename. Click to open the Rename Bitmap dialog and type a new name for the selected ERwin bitmap. When you click OK, the icon name changes to the new name. The name of the original bitmap on disk does not change.

•	Delete. Click to immediately delete the selected icon in ERwin. You cannot delete any of the default ERwin icons. You also cannot delete icon bitmaps from disk.

•	OK. Closes the Icon Editor and saves your changes.

•	Cancel. Closes the Icon Editor dialog and cancels any changes.

Note:	The Icon Editor maintains separate bitmaps for the large entity icons and all other icons used by the small entity, attribute and domain icon editors.

You cannot use the Icon Editor to make graphical changes to any bitmap.

Related Topics

  To import an icon using the ERwin Icon Editor

  Icon Bitmaps Supplied with ERwin


To import an icon using the ERwin Icon Editor
To import an icon bitmap using the ERwin Icon Editor

1.	Choose Entity, Attribute, or Domain Dictionary from the Edit menu.

2.	Choose one of the following:

•	In the Entity Editor, click on the Icon tab.

•	In the Attribute Editor or Domain Dictionary Editor, click on the General tab.

3.	Click on the Open Editor button [image] next to any icon list, to open the ERwin Icon Editor.

4.	Select the Import button.

5.	In the Open File dialog, select a bitmap file (.bmp) to import.

6.	Click OK to import the selected bitmap into ERwin.

7.	If applicable, choose one of the following:

•	To rename an ERwin icon bitmap, select the icon and click Rename. Type a new icon name in the Rename Bitmap dialog, and click OK.

•	To delete an ERwin icon bitmap, select the icon and click Delete.

8.	Click OK in the Icon Editor.


Icon Bitmaps Supplied with ERwin

When you install ERwin, it creates an “Icons” subdirectory in the ERwin program directory. In addition to the default icons contained in ERwin, the Icons directory contains many additional bitmaps for you to use to enhance your logical and dimensional diagrams. You can use the ERwin Icon Editor to import these bitmaps into ERwin, and then assign them to entities, attributes, and domains.

You can find the additional icon bitmap files that are installed with ERwin in:

[Drive]:\<ERwin>\Icons

where ERwin is the default program files directory. You can use any graphics program such as Paint, to view any of these bitmaps files before importing them into ERwin.

Related Topics

  Using Icons to Enhance a Logical Diagram

  Using Icons to Enhance a Physical Diagram

  Using the ERwin Icon Editor

  Enhancing the Appearance of an ERwin Diagram


Working With Entities

Along with attributes, entities are the cornerstone of the logical model. You can specify entity properties such as entity names, definitions, and notes in the Entity Editor.

An ERwin logical model can contain independent and dependent entities. An independent entity is an entity whose instances can be uniquely identified without determining its relationship to another entity. A dependent entity is an entity whose instances cannot be uniquely identified without determining its relationship to another entity or entities. Dependent entities are child entities that include all or a portion of the primary key of the parent entity in their primary key, and rely on the migrated foreign key attributes for identity.

ERwin draws the entity box with a horizontal line that divides the box in half. You can enter the primary key in the top half of the entity box and non-keys in the bottom half of the entity box. You can choose to have keys migrate to either the primary or non-key area of the box. See Foreign Key Migration for more information.

When you add an entity to the diagram, ERwin labels the entity E_n, where E stands for entity, and n is a unique number. ERwin assigns each number only once per model, and calculates new entity numbers beginning from the number zero. See Enforcing Unique Names for more information.

Related Topics

  Creating an Entity

  Using the Entity Tool


Creating an Entity

Independent and dependent entities can be created in ERwin by:

•	Using the Entity Tool

•	Adding tables in the physical model, then opening the logical model. See Working With Tables for more information.

•	Reverse engineering an existing database. See Reverse Engineering from a DDL Script or Database


Using the Entity Tool

ERwin includes a single tool in the ERwin toolbox for creating both independent and dependent entities, as shown below.

The type of entity, independent or dependent, is determined by the type of relationships in which it is involved. When you first place an entity in an ERwin diagram, it is represented as an independent entity. When you connect it to another entity using a relationship tool in the ERwin toolbox, ERwin determines if the entity is independent or dependent based on the relationship type. If an entity is a child entity in an identifying relationship, it appears as a dependent entity (box with rounded corners) in your diagram. All other entities appear as independent entities (box with square corners).

Related Topics

  To create an entity in the logical model


To create an entity in the logical model

1.	Click [image].

2.	Click anywhere on the diagram.

ERwin draws the new entity and labels it E/n, where E stands for entity and n is a unique number.

3.	Type a name for the entity.

4.	Press SHIFT + ENTER to close the edit window for the entity name.

5.	Optionally, you can add one or more attributes to the entity at this time. More>

Note:	The [image] tool creates both independent and dependent entities. When you create an identifying relationship between two independent entities, the child entity automatically becomes a dependent entity.


Using the Entity Editor

Using the Entity Editor, you can specify the properties of an entity such as its name and definition. You can also use the Entity Editor to attach a note to an entity, enter some of the possible queries that you expect to run against it, enter sample data for it, and attach an icon.

When you right-click on an entity and choose Entity Editor on the shortcut menu, ERwin opens the Entity Editor.

The purpose of each control in the Entity Editor is explained below:

•	Entity. Displays the currently selected entity. To view the properties of another entity, select a different entity from the list.

•	Name. Edit the name of the entity.

•	Logical Only. Select this check box if you want the entity to appear in the logical model only. Clear this check box if you want the entity to appear in both the logical and physical model. Logical-only entities do not appear as a table in your data model when you switch to the physical model.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The Entity Editor includes the following tabs:

•	Definition. Enter a definition for an entity.

•	Note. Enter notes for an entity.

•	Note 2. Enter notes for an entity.

•	Note 3. Enter notes for an entity.

•	UDP. Enter user-defined property values for an entity.

•	Icon. Attach an icon to an entity.

Related Topics

  To change an entity name in the Entity Editor

  To display an entity in the logical model only


To change an entity name in the Entity Editor

1.	Right-click on an entity, then choose Entity Editor on the shortcut menu.

2.	Select the entity that you want to change in the Entity list box.

3.	Edit the name for the entity.

4.	Click OK.


To display an entity in the logical model only

1.	Right-click on an entity, then choose Entity Editor on the shortcut menu.

2.	Select the entity that you want to appear in the logical model only in the Entity list box.

3.	Select the Logical Only check box.

4.	Click OK.


Entering an Entity Definition

You use the controls in the Definition tab of the Entity Editor to enter a definition for an entity. The definition that you enter should help any person who reads the data model to understand the purpose for the entity. Follow your organization’s standards and conventions for defining the entities in a data model.

The Definition tab supports backward compatibility with models created in the previous version of ERwin, which may have included additional definitions for each entity. When you open a model created in the previous version of ERwin, any entity definitions appears on the Definition tab.

The purpose of each control in the Definition tab is explained below:

•	Definition. Enter or edit the entity definition in this box.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Using the Entity Editor

  To enter an entity definition


To enter an entity definition

1.	Right-click on the entity you want to change, choose Entity Editor on the shortcut menu, then click the Definition tab.

2.	Enter a definition for the entity.

3.	Click OK.


Attaching an Entity Note

You use the controls in the Note tabs of the Entity Editor to enter any free-form text such as sample data and queries. The Note tabs support backward compatibility with models created in the previous version of ERwin, which may have included additional notes for each entity. When you open a model created in the previous version of ERwin, any entity query information appears on the Note 2 tab, and any entity sample information on the Note 3 tab.

The purpose of each control in the Note tab is explained below:

•	Note. Enter or edit a note in this box.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Using the Entity Editor

  To attach an entity note


To attach an entity note

1.	Right-click on the entity for which you want to attach a note, choose Entity Editor on the shortcut menu, then click the Note, Note 2, or Note 3 tab.

2.	Type a note to attach to the entity.

3.	Click OK.


Specifying Entity UDP Values

After you create UDPs for an entity in the UDP Editor, you can easily specify property values for the entity in the UDP tab of the Entity Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP for you to select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Entity Editor

  To specify entity UDP values

  Creating User-Defined Properties


To specify entity UDP values

1.	Define an entity property. More>>

2.	Select Entity from the Edit menu.

3.	Click on the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Attaching an Icon to an Entity

You use the controls in the Icon tab of the Entity Editor to attach small and large icons to an entity. ERwin displays the small icons when you select Entity Icon from the Display Options/Entities diagram shortcut menu option; and displays the large icons when you select Icon from the Display Level diagram shortcut menu option. For example, you can attach a large icon for presentation purposes to emphasize the type of business organization that the data model represents.

Note:	The graphic that you use for an entity must be a Windows bitmap file (.bmp file extension).

The purpose of each control in the Icon tab is explained below:

•	Small Icon. Select and display an icon bitmap from the list.

•	. Click this button to open the Icon Editor. Use this icon editor only for bitmaps to be used as small icons.

•	Large Icon. Select and display an icon bitmap from the list.

•	. Click this button to open the Icon Editor. Use this icon editor only for bitmaps to be used as large icons.

Note:	Large and small icons are not differentiated by physical bitmap size, but by their use in ERwin.

Related Topics

  Using the Entity Editor

  To attach icons to entities

  Entity Icon Display Option


To attach icons to entities

1.	Right-click on the entity for which you want to attach an icon, choose Entity Editor on the shortcut menu, then click the Icon tab.

2.	Select a bitmap from the Small Icon list.

•	To import, rename or delete an icon, click the Open Editor button [image]. When you import a bitmap, select the drive and directory in which the bitmap is stored, then click on the name of the bitmap that you want to display for the current entity (for example, C:\Windows\Movie.bmp).

3.	Select a bitmap from the Large Icon list.

•	To import, rename or delete an icon, click the Open Editor button [image]. When you import a bitmap, select the drive and directory in which the bitmap is stored, then click on the name of the bitmap that you want to display for the current entity (for example, C:\Windows\Movie.bmp).

4.	Click OK to assign the bitmap to the entity.

Note:	The Icon Editor for small and large icons contains separate icons for large icons and small icons. If you want to use the same bitmap for small and large icons, you must import the bitmap in the Small Icon Editor and in the Large Icon Editor.


Importing and Exporting ERwin Data

In addition to generating SQL DDL scripts and creating DDE reports to send data to another Windows program, you can use ERwin to create special types of text files that you can use to transfer model data to other applications.

•	ERX file format, which is ERwin’s native text format. The .erx file format lets you save the graphical data model information as a text description.

•	SML file format, which is similar to an SQL data definition file. The .SML file format is a special type of text file designed to store information about an ERwin model in text format.

•	EAX and BPX file formats, which lets you exchange ERwin entity and attribute names with BPwin, Logic Works business process modeling tool.

Related Topics

  ERwin Support for Different File Types


Using ERwin's Native Text Format

When you save an ERwin diagram as an .erx file, you can use it as input for other tools and applications. For example, you can save your model in the .erx file format, edit it in a word processing application, and use the application’s spell-checker to correct the notes and definitions. If you use the ERX file as input for other tools, you may want to export the actual value for a property, like column name, that is derived through macros or domain inheritance. You might also take output from another development tool, create scripts or macros to put the data into the .erx file, and then view the file as a graphic ER diagram in ERwin.

ERwin processes .erx files differently than .er1 files. An .erx file must be parsed as it is loaded into ERwin. When ERwin parses an .erx file, it reads it in and interprets it line-by line. This extra step means that it may take considerably longer to open a diagram saved as a .erx file than to open the same diagram saved as an .er1 file. Saving changes to a diagram in .erx file format also takes slightly longer.

When you save your diagram, choose the .erx file format specifically when you want to work with your diagram in text form or export it to another application. Otherwise, save your diagrams in the ER1 format. When you use the Save As option to save an .erx file, ERwin automatically creates a backup file with the extension .bkx.

Note:	To use an .erx file created in previous versions of ERwin, open the file in this version and save it as an .er1 file, which you can then open in the current version.

Related Topics

  Understanding the ERX Format

  Saving Files in ERX and Multiple Format

  To open a diagram saved in ERX format

  To save a diagram in ERX format


Understanding the ERX Format

The text-based .erx file format is designed to transfer model data and comments between ERwin and other tools. Any data that you can enter into ERwin can be imported and exported using the .erx file format.

The organization of diagram information in an .erx file is important. Each section begins with a comment block containing a table description of the data block, followed by the data block itself. In each section, the following syntax rules are used to distinguish various types of information.

•	Comment blocks start with /* and end with */. Do not add new comment blocks or lines between data lines within a data section. The comment block contents are not used by ERwin, however a comment block is a required part of each section. If you leave out an expected comment block, you will not be able to open the file.

•	Attributes and columns are delimited by commas.

•	Text fields are enclosed in double quotes (for example, "some text"). Commas within these double-quote pairs are treated as ordinary characters and are ignored. Logical and physical names (such as entity or attribute names) are regarded as text and are enclosed in double quotes.

•	As in the C programming language, the character string \n indicates a new line within a text field.

•	Blank text fields are indicated by two consecutive double quotes (""). Double quotes to be included as part of a text field are indicated by a preceding backslash (\").

•	A carriage return indicates the start of a new record in the data block.

To understand the .erx file format, you should create a small diagram, save it as an .erx file, and study the output from the diagram. You can then incrementally add new information to the .erx file and load it back into ERwin to see how it affects the diagram. Click here to view a sample ERX file.

Note:	 If you edit an .erx file with a word processing application, remember to save the file as an ASCII text file, without formatting.

Related Topics

  To open a diagram saved in ERX format

  To save a diagram in ERX format


Sample ERX File

The .erx file format looks like the excerpt from the MOVIES.erx shown below.

/*

CREATE TABLE ERWIN_ENTITY

 (ENTITY_ID 	INTEGER 	NOT NULL,

 	ENTITY_TYPE 	VARCHAR(6) 	NOT NULL,

 	ERWIN_MODEL_ID 	INTEGER 	NOT NULL,

 RESERVED 	INTEGER 	NOT NULL,

 	ENTITY_NAME 	VARCHAR(65),

 	ENTITY_NOTE 	LONG VARCHAR,

 	ENTITY_DEFINITION 	LONG VARCHAR,

 	ENTITY_SAMPLE_DATA	LONG VARCHAR,

 	ENTITY_QUERY 	LONG VARCHAR,

 	TABLENAME 	VARCHAR(65)

);

*/

10,"ET_IE",0,0,"EMPLOYEE","","The EMPLOYEEs are involved\nwith many MOVIE-RENTAL-RECORDS.","","","EMPLOYEE"

9,"ET_DE",0,0,"OVERDUE-NOTICE","","An OVERDUE-NOTICE is a\nnotice sent to remind a\nCUSTOMER that a tape needs\nto be returned.","","","OVERDUE_NOTICE"

8,"ET_DE",0,0,"MOVIE-RENTAL-RECORD","","Each MOVIE-RENTAL-RECORD records\na due date for the movie and a status\nindicating whether or not a movie is overdue.","","","MOVIE_RENTAL_RECOR"

7,"ET_DE",0,0,"INVOLVEMENT-RECORD","","An INVOLVEMENT-RECORD lists\nthe involvement of an\nEMPLOYEE to a RENTAL RECORD.","","","INVOLVEMENT_RECORD"

6,"ET_IE",0,0,"MOVIE","","MOVIE is the name given to a\nvideo tape. It may be a \nfeature film, a documentary,\na workout video, a cooking\ninstruction tape, etc..","","","MOVIE"

5,"ET_DE",0,0,"MOVIE-COPY","","A MOVIE-COPY is a particular\ninstance of a movie title\nthat is in stock and can \nbe rented.","","","MOVIE_COPY"

4,"ET_IE",0,0,"CUSTOMER","","CUSTOMER is a person who\nrents one or more videos\nfrom the store.","","","CUSTOMER"


To open a diagram saved in ERX format

1.	Choose Open on the File menu.

2.	Change the File Type option to ERwin ERX.

3.	If necessary, switch to the directory where the file should be stored.

4.	Select the file and click OK.

5.	Click Import ERX.

Note:	If an import error occurs, ERwin displays a message stating the reason for the error. The progress caption in the Import ERX File dialog tells you where the error occurred in the file.


To save a diagram in ERX format

1.	Choose Save As on the File menu.

2.	Change the File Format option to ERX.

3.	Select the destination directory where you want to save ERX format files.

4.	Type a name for the file in the File Name text box.

5.	If you want to export expanded values for one or more properties, complete the following steps:

•	Click the Expand button to open the Expand Property Values dialog.

•	Select the logical and physical properties you want to save actual values for.

•	Click OK.

6.	Click OK.

Note:	To save an ERX file as an .er1 file, choose the Save As option and select the ER1 File Format option. When you use the Save option to save an .erx file, ERwin automatically creates a backup file with the extension .bkx.


Saving Files in ERX and Multiple Format

If you choose the ERX & Multiple file format option in the Save As dialog, ERwin saves the diagram information in multiple text files rather than in one large file. Each text file contains information about one data section and is automatically assigned the diagram name followed by an .xnn file name extension. For example, MOVIES.X23 contains information about the fonts used in the MOVIES diagram.

You can use the ERX & Multiple file format option to save files, but ERwin cannot open files with the .xnn extension. To open files with the .xnn extension and edit them, you must use a word processing application such as Microsoft Word or Windows Notepad.

The file names and the information they contain are listed in the following table.

Type	ERWMETA Table Name	Logical Entity Name
.X01	ENTITY	ERWIN ENTITY
.X02	RELATION	ERWIN RELATIONSHIP
.X03	ENT_ATT	ERWIN ENTITY-ATTRIBUTE USAGE
.X04	SUBTYPE	ERWIN SUBTYPE RELATIONSHIP
.X05	DVOBJ	ERWIN DIAGRAM VIEW OBJECT
.X06	ENT_INDX	ENTITY INDEX
.X07	INDX_MEM	INDEX MEMBER
.X08	DIAG_OPT	ERWIN DIAGRAM OPTION
.X09	TEXT_BLK	TEXT BLOCK
.X10	ENT_PROP	ENTITY PHYSICAL PV
.X11	INDX_MPP	INDEX MEMBER PHYSICAL PV
.X12	INDXPROP	INDEX PHYSICAL PV
.X13	ENT_TRIG	ENTITY TRIGGER
.X14	TRIGCOLS	TRIGCOLS
.X15	VLDRULE	VALIDATION RULE
.X16	VLDVAL	VALID VALUE
.X17	TBLCONST	TABLE CONSTRAINT
.X18	DOMAIN	DOMAIN
.X19	DEF_VAL	DEFAULT
.X20	REL_PHYS	REL PHYSICAL PROPERTY
.X21	REL_TMPL	RELATIONSHIP TEMPLATE
.X22	TEMPLATE	TEMPLATE
.X23	FONT	ERWIN FONT
.X24	COLOR	ERWIN COLOR
.X25	GBL_TMPL	GLOBAL TEMPLATE
.X26	ESPTMPLT	ENTITY STORED PROCEDURE TEMPLATE
.X27	ERW_TEXT	ERWIN TEXT BLOCK
.X28	SUBJECT	SUBJECT AREA
.X29	DISPLAY	STORED DISPLAY
.X30	PHYS_OBJ	PHYSICAL OBJECT
.X31	POBJPV	PHYSICAL OBJECT PV
.X32	ERW_RPT	ERWIN REPORT
.X33	RPT_OPT	ERWIN REPORT OPTION
.X34	DOMAINPV	DOMAIN PV
.X35	ENT_SYN	ENTITY SYNONYM
.X36	SYN_PROP	SYNONYM PHYSICAL PV
Related Topics:

  To save a diagram in ERX and multiple format files


To save a diagram in ERX and multiple format files

1.	Choose Save As on the File menu.

2.	Change the File Format option to ERX & Multiple.

3.	Select the destination directory where you want to save the multiple .erx file format files.

4.	Type a name for the file in the File Name text box.

5.	If you want to export expanded values for one or more properties, complete the following steps:

•	Click the Expand button to open the Expand Property Values dialog.

•	Select the logical and physical properties you want to save actual values for.

•	Click OK.

6.	Click OK.


Exporting Expanded Property Values

You can export the actual expanded values for properties that derive their values from macros or domain inheritance in the Expand Property Values dialog. This dialog is only available when you save a diagram using the .erx or .erx & Multiple file formats.

The Expand Property Values dialog contains the following tabs:

•	Logical. Select the attribute properties for which you want to save the actual expanded values in an .erx file.

•	<Database>. Select the column properties for which you want to save the actual expanded values in an .erx file.

•	PowerBuilder. Select the PB extended attributes for which you want to save the actual expanded values in an .erx file.

•	Visual Basic. Select the VB column properties for which you want to save the actual expanded values in an .erx file.

The purpose of each control in the Expanded Property Values dialog is explained below:

•	Select All. Click this button to select all check boxes and expand all attribute and column properties to their actual values in the .erx file.

•	Clear All. Click this button to clear all check boxes and save ERwin macros and inheritance flags in the .erx file. When you open the .erx file in ERwin, ERwin derives all actual attribute and column properties from the saved information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics:

  To save a diagram in ERX format

  To save a diagram in ERX and multiple format files

  Using ERwin's Native Text Format

  Saving an ERwin Diagram


Expand Property Values - Logical

You can export the actual expanded values for properties that derive their values from macros or domain inheritance in the Expand Property Values dialog. This dialog is only available when you save a diagram using the .erx or .erx & Multiple file formats.

The purpose of each control in the Logical tab of the Expand Property Values dialog is explained below:

•	Name. Save the actual attribute names to an .erx file.

•	Logical Only. Save the actual attribute “Logical Only” properties to an .erx file.

•	Required. Save the actual “Required” property value to an .erx file.

•	Definition. Save the actual attribute definition to an .erx file.

•	Note. Save the actual attribute note to an .erx file.

•	UDP. Save the actual attribute user-defined property (UDP) values to an .erx file.

•	Icon. Save the actual attribute icons to an .erx file.

Related Topics:

  Exporting Expanded Property Values

  To save a diagram in ERX format

  To save a diagram in ERX and multiple format files

  Using ERwin's Native Text Format

  Saving an ERwin Diagram


Expand Property Values - <Database>

You can export the actual expanded values for properties that derive their values from macros or domain inheritance in the Expand Property Values dialog. This dialog is only available when you save a diagram using the .erx or .erx & Multiple file formats.

The purpose of each control in the <Database> tab of the Expand Property Values dialog is explained below:

•	Col Name. Save the actual column names to an .erx file.

•	Datatype. Save the actual column datatypes to an .erx file.

•	Average Width. Migrate the actual column average width estimates to an .erx file.

•	Null Option. Save the actual column null options to an .erx file.

•	Percent NULL. Save the actual the column percent null estimates to an .erx file.

•	Valid Rule. Save the actual validation rules to an .erx file.

•	Default. Save the actual column default values to an .erx file.

•	Comment. Save the actual column definitions to an .erx file.

•	Physical Only. Save the actual the “Physical Only” properties to an .erx file.

•	UDP. Save the actual column user-defined property (UDP) values to an .erx file.

•	Data Sources. Save the actual data source values to an .erx file.

•	Source Comment. Save the actual Transform Comment for the data sources to an .erx file.

The following options are also displayed on this tab, depending on the target server selected:

•	Allocate. Save the actual space allocation property values for VARCHAR() or VARGRAPHIC() datatypes (AS/400 only).

•	Allow Zero. Save the actual allow-zero-length property values assigned to a column (Access only).

•	Case. Save the actual case sensitive property values assigned to a column (PROGRESS and Teradata only).

•	For. Save the actual FOR <subtype data> property values assigned to a column. This control is only displayed when the selected datatype is CHAR, CHAR(), CHARACTER, CHARACTER(), VARCHAR(), or LONG VARCHAR().(DB2/MVS and DB2/2 only)

•	IN. Save the actual assigned blobspace to an .erx file (INFORMIX only).

•	Char Type. Save the actual sub-datatype property for CHAR, CHAR(), CHARACTER, CHARACTER(), GRAPHIC, GRAPHIC(), VARCHAR(), or VARGRAPHIC() datatypes (AS/400 only).

Related Topics:

  Exporting Expanded Property Values

  To save a diagram in ERX format

  To save a diagram in ERX and multiple format files

  Using ERwin's Native Text Format

  Saving an ERwin Diagram


Expand Property Values - PowerBuilder

You can export the actual expanded values for properties that derive their values from macros or domain inheritance in the Expand Property Values dialog. This dialog is only available when you save a diagram using the .erx or .erx & Multiple file formats.

The purpose of each control in the PowerBuilder tab of the Expand Property Values dialog is explained below:

•	Format. Save the actual column format value.

•	Edit Style. Save the actual column edit style format value.

•	Valid Rule. Save the actual validation rule format value.

•	Initial Value. Save the actual column initial value format value.

•	Justify. Save the actual column text justification format value.

•	Case. Save the actual column text case format value.

•	Height. Save the actual the control height format value.

•	Width. Save the actual the control width formatvalue.

•	Bitmap. Save the actual the assigned bitmap format value.

•	Comment. Save the actual the control comment format value.

•	Label. Save the actual the control label format value.

•	Pos. Save the actual the control position format value.

•	Header. Save the actual the control header format value.

•	Pos. Save the actual the control position format value.

Related Topics:

  Exporting Expanded Property Values

  To save a diagram in ERX format

  To save a diagram in ERX and multiple format files

  Using ERwin's Native Text Format

  Saving an ERwin Diagram


Expand Property Values - Visual Basic

You can export the actual expanded values for properties that derive their values from macros or domain inheritance in the Expand Property Values dialog. This dialog is only available when you save a diagram using the .erx or .erx & Multiple file formats.

The purpose of each control in the Visual Basic tab of the Expand Property Values dialog is explained below:

•	Edit Style. Save the actual edit style.

•	Valid Rule. Save the actual validation rule.

•	Initial Value. Save the actual initial value.

•	Help ID. Save the actual Help ID value.

•	Read Only. Save the actual Read Only value.

•	Bitmap. Save the actual assigned bitmap.

•	Required. Save the actual Required value.

•	Empty is Null. Save the actual Empty is Null value.

•	Visible. Save the actual Visible value.

•	Tag. Save the actual tag text.

•	Font Name. Save the actual font type.

•	Font Style. Save the actual font style.

•	Font Size. Save the actual font size.

•	Foreground. Save the actual foreground color.

•	Background. Save the actual background color.

•	Label. Save the actual label text. Select the Pos check box to save the position of the label text.

•	Header. Save the actual header text. Select the Pos check box to save the position of the label text.

•	Accel. Save the actual accelerator key value.

•	Prompt. Save the actual prompt text.

Related Topics:

  Exporting Expanded Property Values

  To save a diagram in ERX format

  To save a diagram in ERX and multiple format files

  Using ERwin's Native Text Format

  Saving an ERwin Diagram


Using ERwin With BPwin

ERwin lets you exchange information with BPwin, Logic Works business process modeling tool, using .bpx files, which contain entity and attribute names. This feature is particularly useful if you develop business process models and data models simultaneously. Any changes that you make to the entity and attribute information in either model can be merged into the other, as follows:

•	BPwin to ERwin. Import entity and attribute information into ERwin from a BPwin model using the .bpx file format. When you import a BPwin model into ERwin, only the BPwin objects that apply to an ERwin diagram are imported, as indicated in the following table:

BPwin Object	Is Imported As…
Entity	Entity
Attribute	Attribute
Activity	Subject Area (optional)
•	ERwin to BPwin. Export entity and attribute names in an ERwin data model to BPwin by saving the data model to:

•	An ERwin xBASE dictionary in .dbf file format.

•	An .eax file.

You can import the resulting .dbf dictionary or .eax file into a new or existing BPwin model.

•	BPwin-ERwin link. Create a two-way link between an ERwin model and a related BPwin model to ensure that the information exchange is complete and accurate each time the link is updated.

Related Topics

  Importing BPwin Entity, Attribute, and Activity Names

  Exporting Entity and Attribute Names to BPwin

  Linking a BPwin Model with an ERwin Model


Importing BPwin Entity, Attribute, and Activity Names

When you import entity, attribute, and activity names from BPwin, a series of dialogs guide you through the process of importing a BPwin .bpx file into a new or existing ERwin data model. The steps include:

1.	Selecting the BPX File for Import - When you choose the BPwin option on the File menu and select the Import option, ERwin displays the Open File dialog. You choose the .bpx file that you want to import from BPwin.

2.	Previewing the Import Status of BPwin Entity and Attribute Names - When you import a .bpx file, ERwin automatically reads the entity and attribute names in the file and attempts to match them with existing objects in the ERwin data model. If some or all of the entity and attribute names in the .bpx file and those in your model do not match, you can preview the unsynchronized entities and attributes that you are importing from BPwin using the ERwin/BPwin Entity Sync Editor and the ERwin/BPwin Attribute Sync Editor.

3.	Importing BPwin Activities as Subject Areas - During import, if ERwin detects any activity names in the .bpx file that do not correspond to a Subject Area in the ERwin data model, it displays the ERwin/BPwin Subject Area Sync Editor. Using this editor, you can group all of the entities associated with a BPwin activity into a new or existing ERwin subject area. If ERwin has incorrectly synchronized a BPwin activity and an ERwin subject area, you can break the link manually. See Using the ERwin/BPwin Subject Area Sync Editor for more information.

4.	Matching Activity and Subject Area Entity Names - After importing the .bpx file, ERwin determines if the entity names in the BPwin activities match the entity names in the corresponding subject area. See Using the ERwin/BPwin Subject Area Entity Sync Editor for more information.

Note:	BPwin automatically includes the names of all activities that have data usage (CRUD/IRUN) assignments in the .bpx file. See the BPwin documentation for more information on CRUD (Create, Read, Update, and Delete) and IRUN (Insert, Read, Update, and Nullify) assignments.

Related Topics

  To import BPwin entity and attribute names into ERwin


Using the ERwin/BPwin Entity Sync Editor

Using the ERwin/BPwin Entity Sync Editor, you can preview the entity names in the .bpx file that do not correspond with entity names in the ERwin data model, before you import the .bpx file into ERwin.

The purpose of each control in the ERwin/BPwin Entity Sync Editor is explained below.

•	Unsynched ERwin Entity. Lists each ERwin entity name that does not correspond with an entity name in the .bpx file.

•	Unsynched BPwin Entity. Lists each entity name in the .bpx file that does not correspond with an entity name in the ERwin data model.

•	ERwin Entity List. Each row in the list displays an ERwin entity name, the corresponding BPwin entity name, and the synchronization action.

•	Cancel. Closes the dialog and cancels any changes.

•	Execute. Sequentially opens the ERwin/BPwin sync editors that list any unsynchronized attribute names or subject area names. If the two files are in sync, no additional editors are displayed.

Related Topics

  Importing BPwin Entity, Attribute, and Activity Names

  Using the ERwin/BPwin Attribute Sync Editor

  Using the ERwin/BPwin Subject Area Sync Editor

  Using the ERwin/BPwin Subject Area Entity Sync Editor

  To import BPwin entity and attribute names into ERwin


Using the ERwin/BPwin Attribute Sync Editor

Using the ERwin/BPwin Attribute Sync Editor, you can preview the attribute names in the .bpx file that do not correspond with attribute names in the ERwin data model, before you import the .bpx file into ERwin.

The purpose of each control in the ERwin/BPwin Attribute Sync Editor is explained below.

•	Unsynched ERwin Attribute. Lists each ERwin attribute name that does not correspond with an attribute name in the .bpx file.

•	Unsynched BPwin Attribute. Lists each attribute name in the .bpx file that does not correspond with an attribute name in the ERwin data model.

•	ERwin Attribute List. Each row in the list displays an ERwin attribute name, the corresponding BPwin attribute name , and the synchronization action.

•	Cancel. Closes the dialog and cancels any changes.

•	Execute. Sequentially opens the ERwin/BPwin sync editors that list any unsynchronized entity names or subject area names. If the two files are in sync, no additional editors are displayed.

Related Topics

  Importing BPwin Entity, Attribute, and Activity Names

  Using the ERwin/BPwin Entity Sync Editor

  Using the ERwin/BPwin Subject Area Sync Editor

  Using the ERwin/BPwin Subject Area Entity Sync Editor

  To import BPwin entity and attribute names into ERwin


Using the ERwin/BPwin Subject Area Sync Editor

Using the ERwin/BPwin Subject Sync Editor, you can preview the activity names in the .bpx file that do not correspond with subject area names in the ERwin data model, before you import the .bpx file into ERwin.

The purpose of each control in the ERwin/BPwin Subject Area Sync Editor is explained below.

•	Unsynched ERwin Subject Area. Lists all user-defined subject areas in the current model.

•	Unsynched BPwin Activity. Lists all activity names in the .bpx file that do not correspond to a subject area in the ERwin data model.

•	Import. Click this button to import a BPwin activity as an ERwin subject area.

•	Export · . This button is not available in this dialog.

•	Ignore. Select a subject area name in the ERwin Subject Area list box and click this button to ignore differences between the activity name and subject area during import.

•	Include Decomp. Select this check box if you want to import the decomposition of the selected activity as individual subject areas. Clear this check box if you want to include the selected activity only. This check box is unavailable if the selected BPwin activity does not contain decompositions.

•	Unsync. Click this button to unmatch the ERwin subject area and BPwin activity names.

•	Cancel. Closes the dialog and cancels any changes.

•	Execute. Click this button to complete the import BPX process.

Related Topics

  Importing BPwin Entity, Attribute, and Activity Names

  Using the ERwin/BPwin Entity Sync Editor

  Using the ERwin/BPwin Attribute Sync Editor

  Using the ERwin/BPwin Subject Area Entity Sync Editor

  To import BPwin entity and attribute names into ERwin


Using the ERwin/BPwin Subject Area Entity Sync Editor

After ERwin associates a BPwin activity with an ERwin subject area, it checks to see if all entity names associated with an activity have a corresponding entity in the subject area. If ERwin locates an entity in either the activity or subject area that does not have a match, ERwin displays list of matched and unmatched entities in the ERwin/BPwin Subject Area Entity Sync Editor.

The purpose of each control in the ERwin/BPwin Subject Area Entity Sync Editor is explained below.

•	Unsynched ERwin SA Entity. Lists all entities included in the selected subject area. Click the name of an entity to sync it with an entity name sync it with a BPwin activity.

•	Unsynched BPwin Act Entity. Lists all entity names that are associated with the selected BPwin activity. Click the name of an activity and click · Import to import the activity as a new subject area. Alternatively, click the name of an activity, click the name of an ERwin subject area, then click · Import to include the entity names associated with the activity in the ERwin subject area.

•	Import. Click this button to import a BPwin entity name into the ERwin subject area shown at the top of the editor.

•	Export · . This button is not operational on this editor.

•	Ignore. Select an entity name in the ERwin SA Entity list box and click this button to ignore the entity during import.

•	Unsync. Click an entity name in the ERwin SA Entity list box and click this button to unmatch the ERwin and BPwin entity names.

•	Cancel. Closes the dialog and cancels any changes.

•	Execute. Click this button to complete the Import BPX process.

Related Topics

  Importing BPwin Entity, Attribute, and Activity Names

  Using the ERwin/BPwin Entity Sync Editor

  Using the ERwin/BPwin Attribute Sync Editor

  Using the ERwin/BPwin Subject Area Sync Editor

  To import BPwin entity and attribute names into ERwin


To import BPwin entity and attribute names into ERwin

1.	Choose Open on the File menu and select the ERwin diagram that you want to update with entity and attribute names from your BPwin model.

2.	Choose BPwin on the File menu, then choose Import.

3.	Select the .bpx file you want to import, then click OK.

4.	Choose one or all of the following options:

•	If your BPwin diagram contains entity names that are not included in the current ERwin model (or vice-versa), ERwin displays the ERwin/BPwin Entity Sync dialog. Click Execute to continue the import process.

•	If the attributes in a BPwin entity and corresponding ERwin entity do not match, ERwin displays the ERwin/BPwin Attribute Sync dialog. Click Execute to continue the import process.

•	If the BPwin diagram contains activities that have CRUD/IRUN data assignments, ERwin displays the ERwin/BPwin Subject Area Sync dialog. You can:

•	Select a BPwin activity name you want to import as a new subject area and click Import. Repeat this step for each subject area you want to add to the ERwin diagram.

•	Select a BPwin activity name and an existing ERwin subject area that you want to synchronize and click Import. Repeat this step for each subject area you want to synchronize in the ERwin diagram.

•	Clear the Include Decomp check box if you do not want to import the decomposition of the selected activity as individual subject areas.

•	Select a subject area/activity row from the ERwin Subject Area list box and click the Unsync button if you want to break the match.

•	Click the Execute button to import the BPwin activity names in the list box as ERwin subject areas. ERwin displays a status report for the import.

5.	If the entity names in the BPwin activity and the corresponding ERwin subject area do not match, ERwin displays the ERwin/BPwin Subject Area Entity dialog. You can:

•	Select a BPwin entity name and an existing ERwin subject area that you want to synchronize and click Import. Repeat this step for each entity name you want to synchronize in the ERwin diagram.

6.	Click OK.

Note:	If you have imported entity names from BPwin, you can choose to manually lay out the diagram or let ERwin lay out the diagram automatically.


Exporting Entity and Attribute Names to BPwin

You can use ERwin to export information to BPwin using:

•	EAX file. Export entity and attribute names in an ERwin diagram as an .eax file. When you export to BPwin, ERwin saves the entity and attribute information in your data model as an .eax file, which you can then import into a BPwin model.

•	DBF dictionary files. Change the target server for an ERwin diagram to Clipper, dBASE, or FoxPro, and create a data model dictionary. ERwin creates the data model dictionary to the specified directory as a set of .dbf files. BPwin can read the .dbf files that comprise the ERwin dictionary, and use the information in the .dbf files to import entity and attribute information from your ERwin data model.

Related Topics

  To export an ERwin model to an EAX file

  To export an ERwin model to BPwin using DBF files


To export an ERwin model to an EAX file

1.	Open the ERwin data model that you want to export to BPwin.

2.	Choose BPwin on the File menu, then select Export.

3.	Select the destination directory where you want to save the .eax file.

4.	Type a name for the .eax file in the File Name text box.

5.	Click OK.


To export an ERwin model to BPwin using DBF files

1.	Choose Open on the File menu, then select the ERwin data model that you want to export to BPwin.

2.	Choose Dictionary Manager on the File menu.

3.	Click the Clipper button, then click OK.

4.	Double-click on an existing directory name or enter a new name in the Directory Name text box, then click OK.

5.	Click the Check In button in the Dictionary Manager dialog.

6.	Click the Check In button. If you have already saved a diagram dictionary to the selected directory, you must confirm the replacement of the existing files.

7.	Click OK. ERwin saves the .dbf files in the directory that you select. You can then import these files into your process model in BPwin.


Linking a BPwin Model with an ERwin Model

You can create a two-way link between an ERwin model and a BPwin model to ensure that the information exchange of entity and attribute names is complete and accurate each time the link is updated. This link is implemented when you import .bpx and .eax files into the corresponding ERwin and BPwin models.

You can link an ERwin data model and a BPwin process model regardless of which program was used to originally enter the entity and attribute names. The link is created when ERwin internal identification numbers for entities are passed from ERwin to the BPwin model dictionary. This happens when you:

•	Import an ERwin dictionary (.dbf files) or .eax file into BPwin. ERwin automatically writes the internal identification numbers to the export file, and BPwin reads them when the file is imported.

•	Export a .bpx file from BPwin, open the .bpx file in ERwin, and then reopen the original BPwin diagram. When you import a .bpx file in ERwin, ERwin updates the file, writing the internal ERwin identification numbers for each entity and attribute in the model into the .bpx file. The next time you open the process model that originated the .bpx file in BPwin, BPwin checks for updates to the ERwin identification numbers and imports them automatically.

Once the link is created, you can change the names of entities in ERwin or BPwin and continue to maintain the link between the original entities, without losing any BPwin data usage information. However, you cannot import entity and attribute names into your BPwin model from any other ERwin model, except when importing by name.

Note:	If you want to match ERwin entities and attributes with similar information in BPwin using the entity names rather than the ERwin internal identification numbers, select ERwin (DBF) in the BPwin Import menu, then choose the Import by Name option on the Import Dictionary dialog. This option bypasses the ERwin internal identification numbers when matching the ERwin entities to entities in BPwin, but is intended for use in unusual circumstances, such as when the originating ERwin diagram has been lost or destroyed.  See the BPwin documentation for more information.

Related Topics:

  To link an ERwin Model to a BPwin Model

  To link a BPwin Model to an ERwin Model


To link an ERwin Model to a BPwin Model

1.	Open the ERwin data model that you want to link to a BPwin model.

2.	Export an .eax file or .dbf file. More>

3.	Open a new or existing BPwin model that you want to link to an ERwin model.

4.	Import the .eax file or .dbf file from the ERwin model. More>

5.	Close and save the model.


To link a BPwin Model to an ERwin Model

1.	Open the BPwin model that you want to link to an ERwin model.

2.	Export the entity and attribute information to a .bpx file.

3.	Close and save the model.

4.	Open a new or existing ERwin data model and import the BPwin entities and attributes into ERwin. More>

5.	Close and save the model.


Working with Indexes

An index is a special type of object designator that is used in relational databases to speed up data retrieval. Just as a book index helps you to find information by quickly listing all of the pages where a particular topic is discussed, an index in a database table points to all of the rows where a particular column value is stored. You can use indexes in two ways:

•	To sequentially access the indexed file.

•	To directly access individual records in the indexed file based on a given value for the indexed field.

ERwin supports these four types of indexes:

•	Primary Key (PK) index

•	Foreign Key (IF) index

•	Alternate Key (AK) indexes

•	Inversion Entry (IE) indexes

You can use ERwin to create indexes in your data model. An index is a component of your model that you manage at the physical level. However, at the logical level, you can define key groups that transform into alternate key and inversion entry indexes at the physical level. See Specifying Alternate or Inversion Entry Keys for more information.

When you create an index, ERwin automatically assigns it all of the columns with the same key designator. For example, if the CUSTOMER entity has two columns designated as AK1, ERwin automatically creates an AK1 index and selects both AK1 columns as the columns for that index. ERwin also assigns the index a default name and assigns default values to all the physical properties of the new index. The default name for an index is specified by the Index Name Macro. See Choosing a Target Database and Setting ERwin Defaults for more information.

When ERwin creates an index, it specifies that primary and alternate key indexes do not accept duplicate values. These settings can prevent you from storing unnecessary and potentially confusing data, such as saving two rows in the CUSTOMER table for the same customer. The Index Editor lets you change the settings for alternate key indexes (by making them inversion entries) so that you can allow or prevent duplicate values for indexed columns. You might change these settings if you expect duplicate information to appear in an indexed column.

ERwin creates a foreign key index automatically when a foreign key is created through migration. You can use ERwin to create a new alternate key or inversion entry index using an existing index as a source. You can also indirectly create a new index in the Column Editor. See Using the Column Editor for more information.

When you generate the schema from a data model, ERwin automatically creates an index for the primary key (PK) and a separate index for each alternate key (AK), foreign key (IF), and inversion entry (IE).

Note:	You can use the Index Editor to create new alternate key (AK) and inversion entry (IE) indexes. However, you cannot create a new primary key (PK) index or foreign key (IF) index using the Index Editor.

Most organizations use specific conventions for naming the objects in a data model. ERwin provides a default name for an index based on the Index Name Macro. You can use the Index Editor to rename, based on your business requirements, the index that is created by ERwin.

Note:	ERwin sequentially numbers foreign key (IF) indexes based on the order in which the foreign keys are created in the diagram. For example, in the MOVIES.ER1 diagram, ERwin assigns IF1 to the first foreign key created in the MOVIE-COPY table, and IF7 to the last foreign key created in the OVERDUE-NOTICE table, which is the seventh table in the data model.

By default, the name for a new index is based on the table name. If you change the table name, ERwin also changes the index name. When you change the index name, you break the association between the index name and the table name.

When you forward-engineer your data model to generate a database schema, ERwin automatically creates a separate index on the primary key of each table, as well as on all alternate keys, foreign keys, and inversion entries, since these columns are most frequently used to search for data. You can use any of the automatically generated indexes to easily create new indexes as your business requirements change. When you create a new index, you can assign different columns to it, and you can change the index properties of your particular database applications.

Related Topics

  Using the Index Editor


Primary Key Index

A primary key (PK) index is an index on the primary key column(s) in a particular table. For example, the movie-number column in the MOVIE table is the primary key in MOVIES.ER1

You can have only one primary key index for a single table. A primary key index is unique, so the indexed columns cannot have duplicate values. ERwin automatically creates a primary key index for each table that has one or more primary key columns. The default name for a primary key index is XPKTableName, as specified by the Index Name Macro. See Choosing a Target Database and Setting ERwin Defaults for more information.

Related Topics

  Foreign Key Index

  Alternate Key Indexes

  Inversion Entry Indexes


Foreign Key Index

A foreign key (IF) index is an index on one or more foreign key columns in a particular table. For example, the renting_customer, master_number, and movie_copy_number columns in the MOVIE_RENTAL_RECORD table are all foreign key indexes in MOVIES.ER1.

ERwin automatically creates a foreign key index for each set of foreign key columns that are migrated through a relationship. The default name for a foreign key index is XIFnTableName, as specified by the Index Name Macro. See Choosing a Target Database and Setting ERwin Defaults for more information.

Related Topics

  Primary Key Index

  Alternate Key Indexes

  Inversion Entry Indexes


Alternate Key Indexes

A unique, or alternate key (AK), index is an index on a set of columns in a particular table other than the primary key column set. Duplicate values in the indexed columns are not allowed. For example, the movie-name column in the MOVIE table is an alternate key index in MOVIES.ER1. You can quickly find a movie by searching for its name, assuming that there are no duplicate movie names.

If you create, at the logical level, an Alternate Key key group that uses one or more columns in a table, ERwin automatically creates the corresponding unique index for the table. At the physical level, you can use the Index Editor to create a unique index on a table. The default name for a unique index is XAKnTableName, as specified by the Index Name Macro. See Choosing a Target Database and Setting ERwin Defaults for more information.

Related Topics

  Primary Key Index

  Foreign Key Index

  Inversion Entry Indexes


Inversion Entry Indexes

A non-unique, or inversion entry (IE), index is an index on a set of columns, other than the primary key column set, in a particular table. Duplicate values in the indexed columns are allowed. For example, the employee-name column in the EMPLOYEE table is an inversion entry index in MOVIES.ER1 so you can quickly find employee information without requiring unique employee names.

If you create, at the logical level, an Inversion Entry key group that uses one or more columns in a table, ERwin automatically creates the corresponding non-unique index for the table. At the physical level, you can use the Index Editor to create a non-unique index on a table. The default name for a non-unique index is XIEnTableName, as specified by the Index Name Macro. See Choosing a Target Database and Setting ERwin Defaults for more information.

Related Topics

  Primary Key Index

  Foreign Key Index

  Alternate Key Indexes


Using the Index Editor

ERwin automatically creates a primary key (PK) and a foreign key (IF) index for each table in your data model, based on the primary key and foreign key columns. If you designate columns as an alternate key group (AK) or inversion entry group (IE), ERwin also generates the equivalent unique (AK) and non-unique (IE) indexes.

Using the Index Editor, you can create new alternate key (unique) and inversion entry (non-unique) indexes for tables in your data model. After you create an index, you can use the Index Editor to modify its properties, such as the index name, column members, physical properties, user-defined properties, and comment. Right-click on a table, then choose <Database> Index on the shortcut menu to open the Index Editor.

The purpose of each control in the Index Editor is explained below:

•	Table. Displays the table associated with the currently selected index. To view the properties of another index, select a different index from the list.

•	 (Table). Opens the Table Editor and edits the properties of the selected table.

•	Index. Displays all indexes on the current table.

•	Show FK Indexes. Displays foreign key indexes in the Index list.

•	New. Opens the New Index dialog and adds a new index.

•	Rename. Opens the Rename Index dialog and edits the name of the selected index.

•	Delete. Deletes the selected index. You cannot delete a primary key or foreign key index. If you delete an alternate key or an inversion entry index, the columns that make up the index are not deleted. ERwin only deletes the alternate key or inversion entry index designator.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The Index Editor includes the following tabs:

•	Members. Creates a new index and selects the column members of an index.

•	<Database>. Specifies the properties of an index.

•	Comment. Adds a comment for an index.

•	UDP. Specifies a user-defined property value for the selected index.

Related Topics

  To delete an index

  Working With Indexes


To delete an index

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Select the index that you want to delete in the Index list.

3.	Click Delete.

4.	Click OK.


Specifying Index Members

You use the controls in the Members tab of the Index Editor to select columns within a table and assign them to an index. Key groups that you create in the logical model become indexes in the physical model. By default, the columns in each foreign key index include all of the columns that are migrated from the same table. If a table includes foreign key columns from two different parent tables, ERwin creates two foreign key indexes, one for each parent table.

The purpose of each control in the Members tab is explained below:

•	Available Columns. Lists all of the columns in the table that are not members of the selected index. Double-click a column in this list or select a column and click [image] to move it to the Index Members list.

•	. Moves the currently selected column from the Available Columns list to the Index Members list.

•	. Moves the currently selected column from the Index Members list to the Available Columns list.

•	Index Members. Lists all of the columns in the table that are members of the selected index. Double-click a column in this list or select a column and click [image] to move it to the Available Columns list.

•	. Moves the selected column in the Index Members list up one position. Unavailable if the selected column is at the top of the list.

•	. Moves the selected column in the Index Members list down one position. Unavailable if the selected column is at the bottom of the list.

•	Column. Displays the name of the currently selected column.

•	DESC. Sorts the selected index in descending order. Clear the check box to sort the index in ascending order. Available only for target servers that support ascending and descending indexes.

Related Topics

  To create a unique index

  To create a non-unique index

  To reorder index members

  To add or remove index members from an existing index

  Using the Index Editor


To create a unique index

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Click the New button.

3.	Optionally, select a key group name for the index in the Key Group list.

4.	Type the index name in the Index text box.

5.	Select the Unique check box to allow only unique values in the index.

6.	Click OK.

7.	Click the Members tab.

8.	Select a column in the Available Columns list, then click [image] to include the selected column in the Index Members list.

9.	Optionally, click [image] or [image] in the Index Members list to move the column up one position or down one position in the index

10.	Click OK. ERwin creates an AK type index on the selected table.

Note:	You cannot use the Index Editor to reorder columns in a foreign key index.


To reorder index members

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Click the Members tab.

3.	Select the index in the Index Members list in which you want to reorder the members.

4.	Click [image] or [image] in the Index Members list to move the column up one position or down one position.

5.	Click OK.

Note:	You cannot use the Index Editor to reorder columns in a foreign key index.


To add or remove index members from an existing index

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Click the Members tab.

3.	Select the index in the Index Members list in which you want to add or remove member columns.

4.	Choose one or more of the following options:

•	To add a member column, double-click a column in the Available Columns list or select a column and click [image] to move it to the Index Members list.

•	To remove a member column, double-click a column in the Index Members list or select a column and click [image] to move it to the Available Columns list.

5.	Click OK.

Note:	You cannot use the Index Editor to add or remove columns from a foreign key index.


To create a non-unique index

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Click the New button.

3.	Optionally, select a key group name in the Key Group box for the index.

4.	Type the index name in the Index text box.

5.	Clear the Unique check box.

6.	Click OK.

7.	Click the Members tab.

8.	Select a column in the Available Columns list, then click [image] to include the selected column in the Index Members list.

9.	Optionally, click [image] or [image] in the Index Members list to move the column up one position or down one position relative in the index

10.	Click OK. ERwin creates an IE type index on the selected table.


Associating ERwin Indexes with Physical Storage Objects

You use the controls in the <Database> tab of the Index Editor to specify the storage properties of an index. The options that you can choose differ depending on the target server that you select.

To see an explanation of the controls available for your target server, click on the name of your server in the list below:

•	AS/400

•	DB2/2

•	DB2/MVS

•	INFORMIX

•	Ingres or OpenIngres

•	InterBase

•	ORACLE

•	PROGRESS

•	Rdb

•	Red Brick

•	SQLBase

•	SQL Server

•	SYBASE

•	Teradata

•	WATCOM/SQL Anywhere

You can use ERwin to specify index properties for these target desktop servers:

•	Clipper

•	dBase III

•	dBase IV

•	FoxPro

•	Microsoft Access

•	Paradox

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


To associate an ERwin index with physical storage objects

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Select an index in the Index list.

3.	Click the <Database> tab.

4.	Select or type the storage properties for the selected index.

5.	Click OK.

Note:	See your server documentation for specific information on the storage properties that it supports and the values that you can enter for each property.


To display an index in the physical model only

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Select the index in the Index list that you want to appear in the physical model only.

3.	Click the <Database> tab.

4.	Select the Physical Only check box.

5.	Click OK.


To prevent an index from appearing in the schema

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Select the index in the Index list that you do not want to generate in the schema script.

3.	Click the <Database> tab.

4.	Clear the Generate check box.

5.	Click OK.


To change the uniqueness requirements for an index

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Select the index for which you want to change the uniqueness requirement in the Index list.

3.	Click the <Database> tab.

4.	Choose one of the following options:

•	To make the index unique, select the Unique check box.

•	To make the index non-unique, clear the Unique check box.

5.	Click OK.


DB2/MVS Index Properties

If your selected target server is DB2/MVS, you can use the DB2 tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the DB2 tab is explained below:

•	UNIQUE. Allows only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	WHERE NOT NULL. Select this check box to have ERwin generate a unique index that ignores null values. Clear this check box if you do not want the index to ignore null values.

•	Generate. Includes a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Specifies that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

The purpose of each control in the Physical Property group box is explained below:

•	TYPE. Includes either a TYPE 1 or TYPE 2 clause in the CREATE INDEX statement.

•	1. Click this button to include a TYPE 1 clause in the CREATE INDEX statement.

•	2. Click this button to include a TYPE 2 clause in the CREATE INDEX statement.

•	USING. Opens the DB2/MVS Using Clause dialog and specifies the physical storage parameters in the Using Clause of the CREATE INDEX statement in the schema for the index. If a DB2/MVS Using Clause is already defined, a description of the clause displays next to the USING button. See Specifying Additional Parameters for DB2/MVS Create Tablespace for more information.

•	Physical Object. Click this button to open the DB2 Physical Object Editor and create or modify physical storage object definitions and parameters. See DB2/MVS Physical Storage Objects for more information.

•	CLUSTER. Select this check box to cluster the index, or physically store the data in indexed order. DB2/MVS allows clustered indexes to be assigned to partitions. As a result, when you select CLUSTER, ERwin enables the Part button so you can specify index partitioning. Clear this check box if you do not want to cluster the index. If a DB2/MVS Using Clause is already defined, the clause syntax is displayed next to the PART button.

•	PART…. Click this button to open the DB2 Using Clause dialog and specify storage parameters for a clustered index. See Specifying Additional Parameters for DB2/MVS Create Tablespace for more information.

•	SUBPAGES. Select this check box to type the number of subpages in each physical page. Clear this check box if you do not want to specify subpages.

•	BUFFERPOOL. Select the name of the buffer pool to which you want to assign the index. BP0 to BP49 are for tables with 4 KB page sizes. BP32K, and BP32K1 to BP32K9 are for tables with 32 KB page sizes.

•	CLOSE. Select this check box to specify that the index uses a close rule. Clear this check box if you do not want the index to use a close rule. A close rule determines if the data sets are candidates for closure when the limit on the number of open data sets is reached. If you clear this check box, ERwin includes the CLOSE NO clause to the CREATE INDEX statement when you generate the schema.

•	DSETPASS. Type a password for the data sets of the index.

•	DEFER. Select this check box if you do not want to build the index during the execution of the CREATE INDEX statement. Clear this check box to build the index during execution of the CREATE INDEX statement. If you defer building the index, ERwin adds the DEFER YES clause to the CREATE INDEX statement when you generate the schema.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


DB2/2 Index Properties

If your selected target server is DB2/2, you can use the DB2 tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the DB2 tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


SQL Server Index Properties

If your selected target server is SQL Server, you can use the SQL Server tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the SQL Server tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Clustered. Select this check box to cluster the index, or physically store the data in indexed order. Clear this check box if you do not want to cluster the index.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

The purpose of each control in the Physical Property group box is explained below:

•	FILLFACTOR. Type a value to define how much data can be added to a data page when creating an index.

•	IGNORE_DUP_KEY. Ignores duplicate key values in a table with a unique index (clustered or not clustered). Clear this check box to prevent duplicate key values in the selected index. When this control is selected, ERwin includes the WITH IGNORE_DUP_KEY clause in the CREATE INDEX clause when it generates the schema. This control is unavailable (dimmed) when a primary or alternate key is selected.

•	SORTED_DATA. Sort index values for the selected index. Clear this check box if you do not want to sort index values.

•	DUP ROW. Makes the IGNORE_DUP_ROW and ALLOW_DUP_ROW check boxes available for the selected index. This control is unavailable (dimmed) when a primary key or alternate key is selected.

•	IGNORE_DUP_ROW. Ignores duplicate rows in a table with a clustered index.

•	ALLOW_DUP_ROW. Allows duplicate rows in a table with a clustered index. Clear this check box to prevent duplicate rows.

•	SEGMENT. Specifies the segment in which you want to store the index.

•	 (Segment). Opens the SQL Server Physical Object Editor and create or modify segments. See SQL Server/SYBASE Physical Storage Objects for more information.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Rdb Index Properties

If your selected target server is Rdb, you can use the Rdb tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the Rdb tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


ORACLE Index Properties

If your selected target server is ORACLE, you can use the ORACLE tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the ORACLE tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

The purpose of each control in the Physical Property group box is explained below:

•	INITRANS. Type the initial number of transaction entries that are allocated within each block.

•	MAXTRANS. Type the maximum number of transactions that can update a data block concurrently.

•	PCTFREE. Type the percentage of each block allocated to a table for future updates to the table’s data.

•	NOSORT. Select this check box to not sort index values. Clear this check box to sort index values.

•	TABLESPACE. Select the tablespace in which you want the current index to be stored.

•	 (TABLESPACE). Click this button to open the Physical Object Editor and create or modify database, tablespace, and rollback segments. See Oracle Physical Storage Objects for more information.

•	INITIAL. Type the size of the initial extent in bytes.

•	NEXT. Type the size of the next extent in bytes.

•	MINEXTENTS. Type the minimum number of extents that can be allocated when you create an index in the tablespace.

•	MAXEXTENTS. Type the maximum number of extents that can be allocated when you create an index in the tablespace.

•	OPTIMAL. Type the optimal size of each extent in bytes.

•	PCTINCR. Type a percent by which an extent can exceed the size of its immediate predecessor.

•	FREELISTS. Type the number of lists maintained by ORACLE that specify which data blocks have space available for new rows to be inserted. Increasing this parameter may improve performance if the application requires many INSERT statements to be processed concurrently.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


SQLBase Index Properties

If your selected target server is SQLBase, you can use the SQLBase tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the SQLBase tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	CLUSTERED HASHED. Select this check box to create a clustered hashed index. Clear this check box if you do not want the selected index to be a clustered hashed index.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Size Rows. Type a value to define the number of rows to store a clustered hashed index. This control is unavailable (dimmed) when you clear the CLUSTERED HASHED check box.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


WATCOM/SQL Anywhere Index Properties

If your selected target server is WATCOM or SQL Anywhere, you can use the WATCOM or SQL Anywhere tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the WATCOM or SQL Anywhere tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	DBSPACE. Select an existing DBSPACE in which to store the selected index. Available only for SQL Anywhere.

•	 (DBSPACE). Click this button to open the SQL Anywhere Physical Object Editor and create or modify DBSPACES. See WATCOM/SQL Anywhere Physical Storage Objects for more information. Available only for SQL Anywhere.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Ingres or OpenIngres Index Properties

If your selected target server is Ingres or OpenIngres, you can use the Ingres or OpenIngres tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the Ingres or OpenIngres tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


SYBASE Index Properties

If your selected target server is SYBASE, you can use the SYBASE tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the SYBASE tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Clustered. Select this check box to cluster the index or physically store the data in indexed order. Clear this check box if you do not want to cluster the index.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

The purpose of each control in the Physical Property group box is explained below:

•	MAX_ROWS_PER_PAGE. Type the maximum number of rows that you want in each segment page.

•	FILLFACTOR. Type a value to define how much data can be added to a data page when creating an index.

•	IGNORE_DUP_KEY. Select this check box to ignore duplicate key values in a table with a unique index (clustered or not clustered). Clear this check box to prevent duplicate key values in the selected index. When this control is selected, ERwin includes the WITH IGNORE_DUP_KEY clause in the CREATE INDEX clause when it generates the schema. This control is unavailable (dimmed) when a primary or alternate key is selected.

•	SORTED_DATA. Select this check box if you want to sort index values for the selected index. Clear this check box if you do not want to sort index values.

•	DUP ROW. Select this check box to enable the IGNORE_DUP_ROW and ALLOW_DUP_ROW check boxes for the selected index. This control is unavailable (dimmed) when a primary key or alternate key is selected.

•	IGNORE_DUP_ROW. Select this check box to ignore duplicate rows in a table with a clustered index.

•	ALLOW_DUP_ROW. Select this check box to allow duplicate rows in a table with a clustered index. Clear this check box to prevent duplicate rows.

•	SEGMENT. Select the segment from the list provided in which you want to store the index.

•	 (Segment). Click this button to open the Physical Object Editor and create or modify segments. See SQL Server/SYBASE Physical Storage Objects for more information.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


AS/400 Index Properties

If your selected target server is AS/400, you can use the AS/400 tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the AS/400 tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	WHERE NOT NULL. Select this check box to generate a unique index that ignores null values. Clear this check box if you do not want the index to ignore null values.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


INFORMIX Index Properties

If your selected target server is INFORMIX, you can use the INFORMIX tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the INFORMIX tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	CLUSTER. Select this check box to cluster the index, or physically store the data in indexed order. Clear this check box if you do not want to cluster the index.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Storage Option. Select this check box to select either the IN dbspace or FRAGMENT BY EXPR storage properties for the selected index.

•	IN dbspace. Select an existing dbspace in which you want to store the current index from the list provided. Available when you select the Storage Option check box.

•	 (IN dbspace). Click this button to open the Physical Object Editor and add a new dbspace, update an existing dbspace, or delete an existing dbspace. See INFORMIX Physical Storage Objects for more information.

•	FRAGMENT BY EXPR. Click this button to fragment the current index by defining one or more row selection expressions. This control is available when you select the Storage Option check box.

•	IN dbspace list. Lists the existing fragmentation expressions for the selected index.

•	expression. Type a valid SQL Boolean expression based on the characteristics of one or more field values in the index. You can type an unlimited number of expression characters. Available when you select the FRAGMENT BY EXPR option.

•	dbspace. Select a dbspace name from the list provided. Available when you select the FRAGMENT BY EXPR option.

•	 (dbspace). Click this button to open the Physical Object Editor and add a new dbspace, update an existing dbspace, or delete an existing dbspace. See INFORMIX Physical Storage Objects for more information.

•	REMAINDER IN. Select a dbspace that will contain the remainder of the index not matching the user-specified "fragment by" expressions.

•	 (REMAINDER IN). Click this button to open the Physical Object Editor and add a new dbspace, update an existing dbspace, or delete an existing dbspace. See INFORMIX Physical Storage Objects for more information.

•	New. Adds the new expression in the expression text box and the selected dbspace to the In dbspace list.

•	Update. Writes any changes to the existing expression and dbspace to the IN dbspace list.

•	Delete. Deletes the selected expression and dbspace from the IN dbspace list.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


PROGRESS Index Properties

If your selected target server is Progress, you can use the Progress tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the Progress tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	PRIMARY. Select this check box to specify that the index is the primary index for the table. Clear this check box if you do not want the selected index to be the primary index for the table.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Abbrev. Select this check box to have ERwin generate an index which lets you search for records by typing only a few characters in the field value. Clear this check box if you do not want the selected index to support the abbreviation option.

•	Word Index. Select this check box to have ERwin generate an index which lets you search for any word within a field. Clear this check box if you do not want the selected index to support the word index option.

•	Active. Select this check box to have ERwin generate an index that is automatically updated each time a new record is created, deleted, or modified. Clear this check box if you do not want the selected index to be active.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Teradata Index Properties

If your selected target server is Teradata, you can use the Teradata tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the Teradata tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	PRIMARY. Select this check box to specify that the index is the primary index for the table. Clear this check box if the index is not the primary index for the table.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Red Brick Index Properties

If your selected target server is Red Brick, you can use the Red Brick tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the Red Brick tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

The purpose of each control in the Physical Property group box is explained below:

•	IN SEGMENT(s). Select the segment in which you want to store the index. The segment you select appears in the IN <segment> clause of the CREATE INDEX statement for the current index.

•	 (IN SEGMENTS). Click this button to open the Physical Object Editor and create or modify segments. See Red Brick Physical Storage Objects for more information.

•	FILLFACTOR. Type a number that you want to appear in the FILLFACTOR clause of the CREATE INDEX statement for the current index. Appears for major tables.

The purpose of each control in the Index Type group box is explained below:

•	BTREE. Select this option to change the index type to BTREE for the current index. Clear this option to not change the index type. Available only in Red Brick version 5.0 or greater.

•	STAR. Select this check box to make the selected index an alternate STAR index. Red Brick automatically generates a STAR index for each major table. In ERwin, you can create one or more alternate STAR indexes on any foreign key column or combination of columns in a major table, other than the primary key.

•	TARGET. Click this button to change the index type to TARGET for the current index and choose a domain size for optimum performance. Clear this option to not change the index type. Available only in Red Brick version 4.0 or greater. The domain size that you choose should be based on the number of possible values in the selected column.

The purpose of each control in the DOMAIN group box is explained below. These controls are available only if the selected index type is TARGET:

•	SMALL. Select this option if the number of possible values (domain) for the index column is less than 100. A small domain size provides the best performance, but requires the most space.

•	MEDIUM. Select this option if the number of possible values (domain) for the index column is between 100 and 1000.

•	LARGE. Select this option if the number of possible values (domain) for the index column is greater than 1000.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


InterBase Index Properties

If your selected target server is InterBase, you can use the InterBase tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the InterBase tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Descending. Select this check box to generate an index that has values sorted in descending order. Clear this check box to sort values in ascending order.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Clipper Index Properties

If your selected target server is Clipper, you can use the Clipper tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the Clipper tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Import. Click this button to open the Clipper Index File Directory dialog and add index information to the data model. See Using the Clipper Index File Directory Dialog for more information.

•	.ndx. Select this option if you want the index file type for the selected index to be .ndx.

•	.ntx. Select this option if you want the index file type for the selected index to be .ntx.

•	Key Expression. Type or edit the key expression for the selected index. The key expression can include multiple field names, operators, and functions.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Using the Clipper Index File Directory Dialog

After you reverse engineer a Clipper database, you can manually add index information to the data model using the Clipper Index File Directory dialog. The purpose of each control in the Clipper Index File Directory dialog is explained below:

•	Table. Displays the name of the currently selected table.

•	Index File Type. Select either .ntx or .ndx to filter the type of index file that you want to import.

•	Table Field. Lists each column that is included in the currently selected table.

•	Index File. Lists available indexes. Select the index file that you want to associate with the table.

•	Table Index. Lists all index files that are associated with the selected table.

•	<-Add. Moves the currently highlighted index file from the Index Tag list to the Table Index list.

•	Remove-> Moves the currently highlighted index file from the Table Index list to the Index Tag list.

•	Index Tag. Lists all of the indexes that can be added to the selected table.

•	Primary Key. Select this check box to specify that the currently highlighted index file in the Table Index list is the primary key for the selected table.

•	Index expr. Displays expression information about the currently highlighted index file, if this information is included in the index definition.

•	Index filter. Displays expression information about the currently highlighted index file, if this information is included in the index definition.

•	Directory. Click this button to search for index files in a different directory.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	If you try to associate an index file that has no valid reference to a table’s columns, ERwin displays an error message and ignores the invalid index.


FoxPro Index Properties

If your selected target server is FoxPro, you can use the FoxPro tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the FoxPro tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Import. Click this button to open the FoxPro Index File Directory Dialog and add index information to the data model. See Using the FoxPro Index File Directory Dialog for more information.

•	Index File. Type the file name for the index.

The purpose of each control in the Index File Type group box is explained below:

•	.idx. Select this option if you want the index file type for the selected index to be standalone .idx.

•	.cdx. Select this option if you want the index file type for the selected index to be either structural or non-structural .cdx.

•	Compact. Select this check box to use the COMPACT clause of the INDEX command. Available only when you select the .idx index file type.

•	Structural. Select this check box to indicate that the .cdx index is structural. Clear this check box if the .cdx index is non-structural. Available only when you select the .cdx index file type.

The purpose of each control in the Sort Order group box is explained below:

•	Ascending. Select this option to sort index entries in ascending order.

•	Descending. Select this option to sort index entries in descending order.

•	Key Expression. Type or edit the key expression for the selected index. The key expression can include multiple field names, operators, and functions.

•	For Clause. Type or edit the For Clause value to filter records in the index to improve search performance.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Using the FoxPro Index File Directory Dialog

After you reverse engineer a FoxPro database, you can manually add index information to the data model using the FoxPro Index File Directory dialog. The purpose of each control in the FoxPro Index File Directory dialog is explained below:

•	Table. Displays the name of the currently selected table.

•	Index File Type. Select either .cdx or .idx to filter the type of index file that you want to import.

•	Table Field. Lists each column that is included in the currently selected table.

•	Index File. Lists available indexes. Select the index file that you want to associate with the table.

•	Table Index. Lists all index files that are associated with the selected table.

•	<-Add. Moves the currently highlighted index file from the Index Tag list to the Table Index list.

•	Remove-> Moves the currently highlighted index file from the Table Index list to the Index Tag list.

•	Index Tag. Lists all of the indexes that can be added to the selected table.

•	Primary Key. Select this check box to specify that the currently highlighted index file in the Table Index list is the primary key for the selected table.

•	Index expr. Displays expression information about the currently highlighted index file, if this information is included in the index definition.

•	Index filter. Displays expression information about the currently highlighted index file, if this information is included in the index definition.

•	Directory. Click this button to search for index files in a different directory.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	If you try to associate an index file that has no valid reference to a table’s columns, ERwin displays an error message and ignores the invalid index.


dBase III Index Properties

If your selected target server is dBase III, you can use the dBase III tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the DBASE III tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Import. Click this button to open the dBase III Index File Directory Dialog and add index information to the data model. See Using the dBase III Index File Directory Dialog for more information.

•	Key Expression. Type or edit the key expression for the selected index. The key expression can include multiple field names, operators, and functions.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Using the dBase III Index File Directory Dialog

After you reverse engineer a dBase III database, you can manually add index information to the data model using the dBase III Index File Directory dialog. The purpose of each control in the dBase III Index File Directory dialog is explained below:

•	Table. Displays the name of the currently selected table.

•	Index File Type. Select .ndx to filter the type of index file that you want to import.

•	Table Field. Lists each column that is included in the currently selected table.

•	Index File. Lists available indexes. Select the index file that you want to associate with the table.

•	Table Index. Lists all index files that are associated with the selected table.

•	<-Add. Moves the highlighted index file from the Index Tag list to the Table Index list.

•	Remove-> Moves the highlighted index file from the Table Index list to the Index Tag list.

•	Index Tag. Lists all of the indexes that can be added to the selected table.

•	Primary Key. Select this check box to specify that the currently highlighted index file in the Table Index list is the primary key for the selected table.

•	Index expr. Displays expression information about the currently highlighted index file, if this information is included in the index definition.

•	Index filter. Displays expression information about the currently highlighted index file, if this information is included in the index definition.

•	Directory. Click this button to search for index files in a different directory. The current directory displays above this button.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	If you try to associate an index file that has no valid reference to a table’s columns, ERwin displays an error message and ignores the invalid index.


dBase IV Index Properties

If your selected target server is dBase IV, you can use the dBase IV tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the dBase IV tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Import. Click this button to open the dBase IV Index File Directory Dialog and add index information to the data model. See Using the dBase IV Index File Directory Dialog for more information.

•	Index File. Type the file name for the index.

The purpose of each control in the Index File Type group box is explained below:

•	.ndx. Select this option if the index file type is .ndx.

•	.mdx. Select this option if the index file type is .mdx.

•	Production. Select this check box if you want the .mdx index file to be a production index file, which is automatically opened when the database is accessed.

The purpose of each control in the Sort Order group box is explained below:

•	Ascending. Select this option to sort index entries in ascending order.

•	Descending. Select this option to sort index entries in descending order.

•	Key Expression. Type or edit the key expression for the selected index. The key expression can include multiple field names, operators, and functions.

•	For Clause. Type or edit the For Clause value to filter records in the index and improve search performance.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Using the dBase IV Index File Directory Dialog

After you reverse engineer a dBase IV database, you can manually add index information to the data model using the dBase IV Index File Directory dialog. The purpose of each control in the dBase IV Index File Directory dialog is explained below:

•	Table. Displays the name of the currently selected table.

•	Index File Type. Select either .mdx or .ndx to filter the type of index file that you want to import.

•	Table Field. Lists each column that is included in the currently selected table.

•	Index File. Lists available indexes. Select the index file that you want to associate with the table.

•	Table Index. Lists all index files that are associated with the selected table.

•	<-Add. Moves the currently highlighted index file from the Index Tag list to the Table Index list.

•	Remove-> Moves the currently highlighted index file from the Table Index list to the Index Tag list.

•	Index Tag. Lists all of the indexes that can be added to the selected table.

•	Primary Key. Select this check box to specify that the currently highlighted index file in the Table Index list is the primary key for the selected table.

•	Index expr. Displays expression information about the currently highlighted index file, if this information is included in the index definition.

•	Index filter. Displays expression information about the currently highlighted index file, if this information is included in the index definition.

•	Directory. Click this button to search for index files in a different directory. The current directory displays above this button.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	If you try to associate an index file that has no valid reference to a table’s columns, ERwin displays an error message and ignores the invalid index.


Access Index Properties

If your selected target server is Access, you can use the Access tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the Access tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Clustered. Select this check box to cluster the index, or physically store the data in indexed order. Clear this check box if you do not want to cluster the index.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Ignore Nulls. Select this check box to specify that records with null values are ignored by the index. Clear this check box to index all records, including those with null values.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Paradox Index Properties

If your selected target server is Paradox, you can use the Paradox tab in the Index Editor to specify the server-specific properties that are associated with the selected index. The purpose of each control in the Paradox tab is explained below:

•	Unique. Select this check box to allow only unique values in the index. Clear this check box to allow non-unique values. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

•	Generate. Select this check box to include a CREATE INDEX statement for the selected index in the generated schema. Clear this check box if you do not want the selected index to appear in the generated schema.

•	Physical Only. Select this check box to specify that you want the index to appear in the physical model only. Clear this check box if you want the index to appear in the logical model as a key group. This check box is unavailable (dimmed) when a primary or foreign key index is selected.

Related Topics

  To associate an ERwin index with physical storage objects

  To display an index in the physical model only

  To prevent an index from appearing in the schema

  To change the uniqueness requirements for an index

  Using the Index Editor


Entering or Editing a Comment for an Index

You use the controls in the Comment tab of the Index Editor to maintain a comment that describes the function or purpose of an index. You can also specify whether you want to update the corresponding key group definition to match the index comment.

The purpose of each control in the Comment tab is explained below:

•	Comment. Type or edit the comment associated with the selected index.

•	Update Key Group Definition To Match. Select this check box to update the corresponding key group definition to match the index comment. Clear this check box if you do not want ERwin to keep the index comment and key group definition in sync.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  To enter a comment for an index

  Using the Index Editor


To enter a comment for an index

1.	Right-click on a table, then choose <Database> Index on the shortcut menu.

2.	Select an index in the Index list.

3.	Click the Comment tab.

4.	Type a comment for the index.

5.	Select the Update Key Group Definition To Match to update the corresponding key group definition to match the index comment that you specify.

6.	Click OK.


Specifying Index UDP Values

After you create UDPs for an index in the UDP Editor, you can easily specify property values for the index in the UDP tab of the Index Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP from which you can select a backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Index Editor

  To specify index UDP values

  Creating User-Defined Properties


To specify index UDP values

1.	Define an index property. More>>

2.	Select Index from the Edit menu.

3.	Click on the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Working With the Physical Model

In ERwin, the physical model is the version of your diagram that captures the exact design of the physical database, including column datatypes and constraints, index assignments, denormalized tables, physical storage assignments, and other physical properties of the database that are generated as a part of the schema for your target server.

You can choose to create a physical model in ERwin four different ways:

•	As the implementation model for a completed, fully attributed logical model.

•	Independently, without concern for the logical model.

•	By reverse engineering an existing target database.

•	In conjunction with the creation of the logical model, so that both the logical and physical models are created simultaneously.

If you have created a logical model and want to view the corresponding physical model, you can choose the Physical Model option from the Logical/Physical Model Option list in the ERwin toolbar, then choose the target database for the model. ERwin displays the physical model that corresponds to the logical model, and activates the physical editors and options that let you further define the properties of physical model objects, such as columns, tables, indexes, views, triggers, and stored procedures.

ERwin tailors the options available to you in the physical model based on the characteristics of the selected target database. For example, column-level properties that are specific to your database appear in the Column Editor, including supported datatypes, null options, and display characteristics; table-level properties are also tailored to your database in the Table Editor, so that you can define physical storage parameters or triggers. Once this model is defined, ERwin can generate it to your target database directly, in the exact syntax required by your system.

ERwin also supports the definition of diagram objects in the logical model as “logical only” and the definition of diagram objects in the physical model as “physical only.” Using these options, you can, for example, fully normalize a logical model and then denormalize the corresponding physical model to enhance database performance or model real-world data structures.

ERwin also automatically converts many-to-many relationships in the logical model when you change to the physical model. The resulting structure in the physical model changes the many-to-many logical relationship into two one-to-many relationships connected to an associative table.

Related Topics

  Comparing Logical and Physical Models

  Using Different Notation for Logical and Physical Models

  Switching Between Logical and Physical Models

  Choosing a Target Database and Setting ERwin Defaults

  Denormalizing the Physical Model

  Resolving Many-to-Many Relationships in the Physical Model


Comparing Logical and Physical Models

Every ERwin diagram automatically includes both a logical and a physical model. By default, the logical model is closely related to the physical model. If you make a change in the logical model, the change is automatically reflected in the physical model and vice-versa.

You can use either the logical model or the physical model to define and document database structures; although the model you use typically depends on the type of work you want to perform. The logical model lets you represent business information and define business rules in a fully normalized data model, while the physical model supports the needs of the database administrator, who focuses on the physical implementation of the model in a database.

ERwin’s support for the separation of the logical model from the physical model also includes features and options in the user interface and ERwin editors, including:

•	Separate editors for the logical and physical model.

•	Optionally, separate modeling notation for the logical and physical model. See Using Different Notation for Logical and Physical Models for more information.

•	Different display levels and options for the logical and physical model. See Logical and Physical Modeling Display Levels and Logical and Physical Modeling Display Options for more information.

•	Different tools in the ERwin toolbox. See ERwin Logical Toolbox Buttons  and ERwin Physical Toolbox Buttons for more information.

Although previous versions of ERwin also supported both logical and physical constructs, the current version lets you create a logical model that is different from, but related to a physical model. For example, you can flag certain objects in the logical model as “logical only” so that they do not appear in a corresponding physical model, and vice-versa.

Other items are available for one modeling environment but not the other. For example, you can create many-to-many relationships and subtype relationships in the logical model only (these constructs must be resolved in the physical model). Similarly, you can include views and view relationships in the physical model only.

Related Topics

  Switching Between Logical and Physical Models

  Using Different Notation for Logical and Physical Models


Using Different Notation for Logical and Physical Models

The logical and physical models can look very different, depending on the notation selected (IDEF1X , IE , or DM), the display options selected, and the modeling decisions to mark diagram items “logical only” or “physical only”. In the example below, the logical model (on the left) is in IE notation and display preferences are set to hide migrated attributes. In contrast, the corresponding physical model (on the right) is in IDEF1X notation and display preferences are set to show datatype and null option, migrated attributes, and rolenames.

Related Topics

  Switching Between Logical and Physical Models

  Logical and Physical Modeling Notation


Switching Between Logical and Physical Models

You can easily switch from the logical model to the physical model and back to the logical model simply by selecting an option from the Logical/Physical Model option list on the ERwin toolbar. ERwin identifies the physical model as Dimensional in the option list when you use Dimensional Modeling (DM) notation.

You can also choose the Logical Model or Physical Model option on the Edit menu to change which model is displayed. Both options are available regardless of the diagram, subject area, or stored display that you select.

Related Topics

  Using Different Notation for Logical and Physical Models

  Comparing Logical and Physical Models


Comparing Logical and Physical Model Objects

Just as in earlier versions of ERwin, most of the objects in the logical model correspond to a related object in the physical data model. For example, the logical model contains entities, attributes and key groups, which are represented in the physical model as tables, columns, and indexes, respectively. The following table compares the logical and physical objects in an ERwin model.

Logical Model	Physical Model

Entity	Table

Dependent entity	FK is part of child table’s PK

Independent entity	Parent table or, if child table,

    FK is NOT part of child table’s PK

Attribute	Column

Logical datatype 	Physical datatype

(text, number, datetime, blob)	(such as char(18), int, or varchar)

Domain (logical)	Domain (physical)

Key group	Index

Primary key (PK)	PK (in diagram) and PK Index (in schema)

Foreign key (FK)	FK (in diagram) and FK Index (in schema)

Alternate key (AK)	A unique, non-primary index

Inversion entry (IE)	A non-unique index

Relationship	Relationship implemented using FKs

Identifying 	FK is part of child table’s PK (above the line)

Non-Identifying	FK is NOT part of child table’s PK (below the line)

Subtype	Denormalized tables

Many-to-many	Associative table

Referential Integrity	INSERT, UPDATE, and DELETE Triggers
 (cascade, restrict, set
 null, set default)

Cardinality	INSERT, UPDATE, and DELETE Triggers

N/A	View or view relationship

N/A	Pre- and post-script

Note:	You can specify whether an object is included in the logical or physical model, or both using the “Logical Only” and “Physical Only” check boxes in the corresponding ERwin editor.

Related Topics

  Comparing Logical and Physical Models

  Switching Between Logical and Physical Models


Choosing a Target Database and Setting ERwin Defaults

Before you define physical schema names, datatypes, or other physical properties, you must choose the target DBMS where ERwin creates the physical schema, and specify the default datatype, null option, and other defaults ERwin should use when it generates columns.

Although you do not have to choose the target server before you begin designing a data model –  you can come back and choose a different database or adjust the default settings at any time –   if you select the target server when you start work on the physical model, ERwin can help you define the physical schema by providing DBMS-specific datatypes and name length warnings. For this reason, we recommend that you choose your target server before you start to work on the schema.

To choose the target DBMS, select the Target Server on the Server menu. ERwin displays the Target Server Editor.

The purpose of each control on the Target Server dialog is explained below:

•	Target SQL DBMS. Click the option button next to the target server you want to assign to the active diagram.

•	Target Desktop DBMS. Click the option button next to the target server you want to assign to the active diagram.

•	<Database> Version. Select the version of your target SQL or desktop DBMS from the list provided.

•	Default <Database> Datatype. Displays the default datatype that ERwin assigns when you add a column to your model. To change the default datatype, select a different datatype from the list and enter arguments for precision and/or scale, if necessary.

•	Table Name Macro. Displays the macro that ERwin uses to generate table names in your model. The default macro is %EntityName(). This macro generates the entity name as the default name of each table in the physical model. You can type different macros or text to change the default table names. When you do, be sure to use the Reset Names button to reset all table names.

•	Index Name Macro. Displays the macro that ERwin uses to generate index names in your model. The default macro is %KeyType%TableName. This macro generates a name that includes the key type, such as XPK (primary key index) or XIE2 (the second inversion entry index defined), and table name, such as MOVIES or CUSTOMER, resulting in a name such as XPKMOVIES or XIE2CUSTOMER. You can type different macros or text to change the default name for indexes to a different name.

•	Reset Names. Click this button to open the Globally Reset DBMS Property dialog and reset the names of all physical model objects, such as tables, columns, and relationships, to the name of the corresponding logical model object or to the default setting. See Globally Resetting DBMS Properties to Default Values for more information.

•	RI Defaults. Click this button to open the Referential Integrity Default Editor dialog and specify the default referential integrity rules that you want ERwin to assign when you add a relationship to your model. See Using the Referential Integrity Default Editor for more information.

•	Default Non-Key Null Option or Null Option. Specify the default null option that you want ERwin to assign when you add a column to your model. Options may include:

•	Not Null (All target DBMSs)

•	Null (Sybase, SQL Server, Oracle, Clipper, FoxPro, and dBASE only)

•	With Null (Ingres and OpenIngres only)

•	Trigger Delimiter. Specify the delimiter for trigger code that you want to appear in the schema DDL. See Trigger Delimiter Option for more information. (DB2 and Interbase only)

•	Library. Select the connection library you want to use to connect to the Sybase target server. See Selecting a Connection Library for SYBASE for more information.

•	Trigger Directory. Specify the directory in which you want ERwin to generate triggers during schema generation for the PROGRESS target server. See Specifying Default Trigger Directories for PROGRESS for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

When you change the target server, ERwin asks if you want it to automatically convert the schema datatypes to datatypes supported on your new target server. See Using ERwin to Convert From One DBMS to Another for more information.

Note:	You can also change the datatype or null option for a particular column or override the default RI settings for a particular table or relationship through other ERwin editors.

Related Topics

  To select a target server DBMS

  To set the default datatype for new columns

  To change the default null option for new columns

  To change physical names to match logical names

  Connecting ERwin to a Target Server

  Defining ODBC Data Sources


Selecting a Connection Library for SYBASE

ERwin lets you choose which connection library, CTLIB or DBLIB, you want to use to connect to your SYBASE database. You choose the connection library type using the Library controls in the Target Server dialog for SYBASE. The option you choose determines the connection library ERwin uses to connect to the database.

The purpose of each control in the Library group box is explained below:

•	dblib. Click this option to specify DBLIB as the connection library ERwin uses to connect to your SYBASE database.

•	ctlib. Click this option to specify CTLIB as the connection library ERwin uses to connect to your SYBASE database.

Related Topics

  Choosing a Target Database and Setting ERwin Defaults


Globally Resetting DBMS Properties to Default Values

When you click the Reset Names button on the Target Server dialog, ERwin opens the Globally Reset DBMS Property dialog.

The purpose of each control in the Reset Properties For group box is explained below:

•	All Table Names. Resets all table names to the name of the equivalent entity in the logical model. In the physical model, ERwin automatically replaces any spaces in the logical names with underscores.

•	All Relationship Names. Resets all relationship names in the physical model to the relationship name in the logical model. In the physical model, ERwin automatically replaces any spaces in the logical names with underscores.

•	All Index Names. Resets all index names to the default name created from the index name macro specified in the Target Server dialog.

•	Selected DBMS Column Properties. Resets all column properties to the default option or logical equivalent, based on the options set on the <Database>, PowerBuilder, or Visual Basic tabs.

•	OK. Click this button to close the dialog. When you close the Globally Reset DBMS Property, ERwin automatically resets the properties of all columns, relationships, indexes, and tables throughout your diagram, based on your selections.

•	Cancel. Click this button to close the dialog and cancel your changes.

The purpose of each control in the <Database> tab is described below:

•	Col Name. Select this check box to reset column names to those of the corresponding attribute in the logical model. In the physical model, ERwin automatically replaces any spaces in the logical names with underscores.

•	Datatype. Select this option if you want to reset column datatype to the default specified in the Target Server dialog.

•	Null Option. Select this option if you want to reset column null option to the default specified in the Target Server dialog.

•	Valid Rule. Select this option if you want to detach all validation rules from all columns in the model.

•	Default. Select this option if you want to detach all default values from all columns in the model.

•	Comment. Select this option if you want to reset column comments in the physical model to match the corresponding attribute definitions in the logical model.

•	Physical Only. Select this option if you want to reset the “physical only” property to the default (cleared).

The following options are also displayed in this dialog, depending on the target server selected:

•	Allocate. Select this option if you want to reset the space allocation property for VARCHAR() or VARGRAPHIC() datatypes to the default (AS/400 only).

•	Allow Zero. Select this option if you want to reset the allow-zero-length property assigned to a column to the default (Access only).

•	Case. Select this option if you want to reset the case sensitive property assigned to a column to the default (PROGRESS and Teradata only).

•	For. Select this option if you want to reset the FOR <subtype data> property assigned to a column to the default. This control is only displayed when the selected datatype is CHAR, CHAR(), CHARACTER, CHARACTER(), VARCHAR(), or LONG VARCHAR().(DB2/MVS and DB2/2 only)

•	IN. Select this option if you want to detach all blobspaces from all columns in the model (INFORMIX only).

•	Char Type. Select this option if you want to reset the sub-datatype property for CHAR, CHAR(), CHARACTER, CHARACTER(), GRAPHIC, GRAPHIC(), VARCHAR(), or VARGRAPHIC() datatypes to the default (AS/400 only).

Additional options on this dialog support server-specific column properties. For information on these properties, click on your target server below:

•	Access

•	AS/400

•	PROGRESS

•	Teradata

The controls on the <Client> tab let you specify which of the PowerBuilder or Visual Basic extended attributes you want to reset to a foreign key. See Globally Resetting PB Extended Attributes to Domain Defaults for more information on the controls on the PowerBuilder tab.  See Globally Resetting VB Column Properties for more information on controls on the Visual Basic tab.

Related Topics

  To change physical names to match logical names

  Choosing a Target Database and Setting ERwin Defaults


To select a target server DBMS

1.	Choose Target Server on the Server menu.

2.	Select the target server you want to assign to the active ERwin diagram in the Target SQL DBMS or Target Desktop DBMS group box.

3.	Select a target server version from the <Database> Version list box or specify additional target server specific information in the available controls.

4.	Choose one or more of the following options:

•	To change the default datatype, select a new datatype in the Default <Database> Datatype list box. If required, enter parameters for scale and/or precision.

•	To change the null option, click a button in the Default Non-Key Null Option or Null Option group box.

•	To change the referential integrity default settings, click RI Defaults button.

•	To reset the names of all physical diagram objects to that of the corresponding object in the logical model, click the Reset Names button.

•	To change the name assigned by ERwin to indexes, edit the text in the Index Name Macro text box.

5.	Click OK.


To set the default datatype for new columns

1.	Choose Target Server on the Server menu.

2.	Select a new datatype in the Default <Database> Datatype list box to specify the default datatype for all new columns added to the active diagram..

3.	If required, enter or change the default parameters for scale and/or precision.

For example, you might change the default from CHAR(18) to CHAR(10).

4.	Click OK.


To change the default null option for new columns

1.	Choose Target Server on the Server menu.

2.	Click a button in the Default Non-Key Null Option or Null Option group box to specify the default null setting for all new columns added to the active diagram. Options include:

•	Null

•	Not null

•	With null

3.	Click OK.


To change physical names to match logical names
To globally reset physical names to match logical names

1.	Choose Target Server on the Server menu.

2.	Click the Reset Names button.

3.	Click the appropriate check box to change:

•	All table names to their logical entity names.

•	All relationship physical names to their logical verb phrases.

•	All index names to the original default names.

•	Specified properties for all columns to the default, or to the value of the corresponding  attribute property.

4.	Click OK. ERwin asks you to confirm your decision.

5.	Click Yes.


Using ERwin to Convert From One DBMS to Another

When you are modeling, there may be times when you want to change the target DBMS for the active model from one server to a different one. For example, you may want to port an existing database to a different DBMS. You can use ERwin to perform most of the conversion for you simply by reverse engineering the database and then changing the target server.

You can choose the new server from the Target Server dialog, accessed from the Server menu in a physical model. After you choose a new server, ERwin offers to automatically convert the datatype assigned to each attribute to the nearest datatype available on your new target server. See Chapter 3, Datatype Mapping in the ERwin Reference Guide for more information on how ERwin converts from the source datatypes to those supported by the new target server.

If there is no matching datatype available on your new target server for one or more of the attributes in your data model (e.g., the original DBMS supports a GRAPHIC datatype, and there is no equivalent on new target server), ERwin asks if you want it to generate a datatype mapping exception report that lists the unconverted datatypes. You then can manually convert any datatypes that ERwin was unable to convert.

When you confirm that you want to convert datatypes, ERwin also lets you choose whether or not you want to convert domain datatypes. If you choose not to convert domain datatypes and you have created domains in the ERwin model, the datatype settings for these domains are not updated to reflect the new target server. You will then need to update these datatypes manually for them to work correctly for the new target server.

Related Topics

  To convert datatypes when you change the target server


To convert datatypes when you change the target server

1.	Choose the Target Server on the Server menu.

2.	Select the new target server and click OK. ERwin prompts you to automatically convert the datatypes to those of the new target server.

3.	If you also want ERwin to convert the datatype settings for any user-defined domains in the ERwin model, leave the Convert Domain Datatypes check box selected.

4.	Click Yes.

Note:	If you do NOT want ERwin to convert the datatypes attached to any user-defined domains in your model, clear the Convert Domain Datatypes check box. ERwin maintains the datatype from the original target server, and does not convert it to a datatype supported on the new target server.

If you answer No when ERwin offers to convert the datatypes in Step 4, you must convert datatypes manually, or convert to a third server and come back again to have them changed.


Connecting ERwin to a Target Server

To compare the information stored on the server with the information defined in ERwin and import or export data from one to the other, ERwin must create an active connection to the target database. ERwin can connect to the system catalog in the target database via:

•	The native interface utilizing vendor-provided functions for talking to that catalog.

•	ODBC (Open Database Connectivity) middleware.

The exact DLL required to connect to each target database that ERwin supports is listed in the table below.

DBMS	Connect Via
AS/400	ODBC.DLL
DB2/MVS	ODBC.DLL
DB2/2	ODBC.DLL
INFORMIX	LDLLSQLW.DLL and ODBC.DLL
Ingres/OpenIngres	ODBC.DLL
InterBase	ODBC.DLL
ORACLE 6	ORA6WIN.DLL
ORACLE 7.x	ORA7WIN.DLL
PROGRESS	ODBC.DLL
Rdb	ODBC.DLL
Red Brick	ODBC.DLL
SQLBase	SQLAPIW.DLL
SQL Server	W3DBLIB.DLL
SYBASE	W3DBLIB.DLL
Teradata	ODBC.DLL
WATCOM/SQL Anywhere	ODBC.DLL
Note:	If you are using DB2/MVS, the initial connection to the DBMS using ODBC may take a few hours. This is because the initial connection requires that DB2/MVS binds the ODBC device as a part of connection. Subsequent connections should take only a few minutes.

Related Topics

  To log on to the current target server

  To disconnect from a server

  Defining ODBC Data Sources


To log on to the current target server

1.	If you are using ODBC to connect to your target server, you may need to setup the ODBC driver to point to the database to which you want to connect. More>

2.	If you do not already have the <Database> Connection dialog open, choose <Database> Connection on the Server menu to open it.

3.	In the <Database> Connection dialog, type:

•	Your login name for the current target server (if required).

•	Your password for the current target server (if required).

•	Server name (if required).

•	Database name or ODBC data source. Click Browse to search for the name of your database or ODBC data source.

4.	Click Connect.

Note:	Whenever you try to access information on a target server, ERwin displays the <Database> Connection dialog and requires a new connection to the target database. You must log on to the selected target server (even if you have previously logged on) by providing a valid name, password, database name, server name, and/or any other information that the target server requires.

Contact your system administrator if you are unsure of your login name, password, database name, server name, and/or any other information that the target server requires for logon.

If you are using DB2/MVS, the initial connection to the DBMS using ODBC may take a few hours. This is because the initial connection requires that DB2/MVS binds the ODBC device as a part of connection. Subsequent connections should take only a few minutes.


To disconnect from a server

1.	If you do not already have the <Database> Connection dialog open, choose <Database> Connection on the Server menu to open it.

2.	Click Disconnect.


Defining ODBC Data Sources

ERwin uses ODBC (Open Database Connectivity) software to access some target databases and to perform tasks such as schema generation or accessing the ERwin Dictionary. ODBC divides data access tasks between a database driver and a data source. An ODBC database driver is a dynamic link library that communicates requests to a particular database management system, such as Access or Paradox. An ODBC data source is a stored specification that associates a particular driver with the database files that you want to access with that driver, such as Access .MDB files.

If you want to connect a specific target database to ERwin, you can define it as an ODBC data source using the ODBC Administrator program. The ODBC Administrator comes with Microsoft Access, FoxPro, Excel, Word for Windows, and other software packages that support ODBC drivers for data access.

For Clipper, dBASE, and FoxPro databases, you can connect to the target server and generate a database using either ODBC or by directly generating the .DBF files in the database. If you do not define an ODBC data source for these databases, ERwin automatically prompts you to provide the pathname for the database when you access the ERwin Dictionary or generate a schema. ERwin supports more features in the ERwin Dictionary and schema generation when you use ODBC, than it does when you use a direct connection to the .DBF files.

Note: 	The ODBC Administrator is available in 16-bit and 32-bit versions. Use the appropriate version for your operating system environment.

For information on using client tools like PowerBuilder to configure ODBC data sources, see the documentation that comes with your client development tools, such as PowerBuilder's Connecting to the Database Guide.

Related Topics

  To define an ODBC data source for desktop databases

  To define an ODBC data source for SQL databases


To define an ODBC data source for desktop databases

1.	Open the Windows Control Panel in Windows 3.11, Windows NT, or Windows 95.

2.	Double-click on the ODBC icon to start the ODBC Administrator program. The current list of data sources is displayed in the Data Sources dialog.

3.	If the driver for your database is not on the list, click Add to search for the driver and include it in the list.

4.	Select your DBMS name in the User Data Sources list box, then click Setup.

5.	Complete the Data Source Name and Description text boxes by typing a data source name and description, respectively. Because each driver requires slightly different information, click the Help button for instructions on how to fill in the setup for a specific data source.

6.	Click the Select button.

7.	Locate your physical database and click OK.

8.	From the ODBC Setup dialog, verify that the selected table and path is correct, then click OK.

9.	If you want to assign an logon name and password to the data source, click the Advanced button and type the Logon Name and Password in the respective columns. If you assign a logon name or password, you will need them to connect to the target server in ERwin.

10.	Click Close.


To define an ODBC data source for SQL databases

1.	Open the Windows Control Panel in Windows 3.11, Windows NT, or Windows 95.

2.	Double-click on the ODBC icon to start the ODBC Administrator program. The current list of data sources is displayed in the Data Sources dialog.

3.	If the driver for your database is not on the list, click Add to search for the driver and include it in the list.

4.	Select your DBMS name in the User Data Sources list box, then click Setup.

5.	Click the Help button in the ODBC program for assistance with defining the ODBC data source information for your target database.


Denormalizing the Physical Model

ERwin lets you denormalize the structure of the logical model so that you can build a related physical model that is designed effectively for the target RDBMS. The ERwin features that support denormalization include:

•	“Logical only” properties for entities, attributes, key groups, and domains. You can mark any item in the logical model “logical only” so that it appears in the logical model, but does not appear in the physical model. For example, you can use the “logical only” settings to denormalize subtype relationships or support partial key migration in the physical model.

•	“Physical only” properties for tables, columns, indexes, and domains. You can mark any item in the physical model “physical only” so that it appears in the physical model only. This setting also supports denormalization of the physical model because it enables the modeler to include tables, columns, and indexes in the physical model that directly support physical implementation requirements.

Related Topics

  Using Different Notation for Logical and Physical Models

  Comparing Logical and Physical Models


Resolving Many-to-Many Relationships in the Physical Model

ERwin provides support for resolving many-to-many relationships in both the logical and physical models. You resolve the many-to-many relationship in the logical model, using the Resolve Many-to-Many option on the Relationship shortcut menu. ERwin creates an associative entity and lets you add additional attributes.

If you do not resolve a many-to-many relationship in the logical model, ERwin automatically resolves the relationship in the physical model and maintains the link between the original logical design and the new physical design.

ERwin resolves the relationship by creating an associative table in the physical model. You can then update the associative table to contain additional columns or indexes, specify physical storage parameters, and attach scripts, triggers, or stored procedures.

Related Topics

  Resolving Many-to-Many Relationships

  Creating a Many-to-Many Relationship


Choosing Modeling Preferences and Diagram Display Options

ERwin has many modeling preferences and diagram display options that you can use to design and enhance a diagram. For example, you can choose whether ERwin uses Integration DEFinition for Information Modeling (IDEF1X) notation, Information Engineering (IE), or Dimensional Modeling (DM) notation. You can also change preferences so that ERwin automatically adjusts the position of each relationship line and shadows appear for entities and tables.

You can choose different display levels and options for the logical and physical model. In the logical model, you can view different levels of information such as the entities, attributes, primary keys, definitions, and icons. You can view logical information for your entities and relationships, such as rolenames and attributes, migrated attributes, foreign key designators, logical datatypes and domains, primary key icons, attribute icons, entity icons, verb phrases, cardinality, and referential integrity symbols. In the physical model, you can view different levels of information such as the tables, columns, primary keys, comments, and physical order. You can view physical information for your tables and views such as the column domain, column datatype, view column alias, and view column datatype.

Modeling preferences and diagram display options help you to improve the presentation of a data model. You can change the magnification level for a diagram to increase or decrease the information that displays, fit the entire diagram in a single window, and highlight a particular aspect of the model. You can add a shadow effect to the entities and tables within a model.

An ERwin template stores diagram preferences and settings such as background color, foreign-key color, and shadow offset, that are automatically applied to each new diagram based on the template. In addition, you can set the display levels and options differently in each stored display that you create. See Creating a New ERwin Diagram and Working with Stored Displays for more information.

There are some additional modeling preferences that you can select when you edit and arrange the objects within a diagram. See Editing and Arranging Diagram Objects for more information.

Related Topics

  Setting ERwin Diagram Preferences

  Enforcing Unique Names

  Changing Logical Display Levels

  Changing Logical Display Options

  Changing Physical Display Levels

  Changing Physical Display Options

  Changing the Diagram Magnification Level

  Adding the Shadow Effect


Setting ERwin Diagram Preferences

You use ERwin to set various preferences and customize the appearance of a diagram and ERwin menus. When you open a diagram, ERwin checks your preferences and displays the diagram and menus you request. You can set different preferences for each diagram.

Choose Preferences on the Option menu to open the Preferences dialog. Click on a tab at the top of the dialog to view a set of preference options.

The Preferences dialog includes the following tabs:

•	Editing Option. Select list and menu preferences for the logical and physical model.

•	Methodology. Select modeling notation preferences for the logical and physical model.

•	Display Options. Select display option preferences for the logical and physical model.

The following buttons appear on all tabs of the Preferences dialog:

•	OK. Closes the dialog and saves your preferences.

•	Cancel. Closes the dialog and cancels any preferences.

•	Apply. Saves the preferences for the current tab.

•	Help. Opens ERwin Online Help for the current tab of the Preferences dialog.


Selecting List and Menu Preferences

The Editing Option tab in the Preferences dialog includes options that let you control whether the Name Tips feature is enabled and whether Structured Modeling Language (SML) options are displayed on the Option menu.

The purpose of each control in the Editing Option tab is explained below:

•	List Box Name Tips. Select this check box to display the full name of an item in a list, even if its name is wider than the list window. Clear this check box to not use the Name Tips feature.

•	Show SML. Select this check box to add the SML menu options to the Option menu. Clear this check box to hide the SML menu options.

Related Topics

  To select list and menu preferences

  Working with the Structured Modeling Language (SML)

  Setting ERwin Diagram Preferences


To select list and menu preferences

1.	Choose Preferences on the Option menu.

2.	Click the Editing Option tab.

3.	Choose one or more of the following options:

•	To display the full name of an item in a list, even if its name is wider than the list window, select the List Box Name Tips check box. To not use the Name Tips feature, clear the check box.

•	To add the Structured Modeling Language (SML) menu options to the Option menu, select the Show SML check box. To hide the SML menu options, clear the check box.

4.	Click OK.

Hint:	Click Apply to save your preferences before moving to a different tab.


Selecting Modeling Notation Preferences

The Methodology tab in the Preferences dialog includes options that let you choose a diagram notation for the logical and physical model. You may want to choose a different notation for the logical and physical models to help you distinguish between them.

Logical Notation options are:

•	IDEF1X. Click this button to use IDEF1X (Integration DEFintion for Information Modeling) notation for logical modeling.

•	IE. Click this button to use IE (Information Engineering) notation for logical modeling.

Physical Notation options are:

•	IDEF1X (Physical).Click this button to use IDEF1X notation for physical modeling.

•	IE (Physical). Click this button to use IE notation for physical modeling.

•	DM (Physical). Click this button to use Dimensional Modeling notation for physical modeling. You can choose to convert diagram relationships to diagonal lines.

•	Display conformance warnings. If you select DM notation, select this check box to display warning messages when your dimensional model does not conform to dimensional modeling rules. ERwin verifies relationships and dimensional modeling roles according to star schema design rules. For example, if you select this option a warning message displays when you draw a relationship from a Fact table (parent) to a Dimension table (child).

Related Topics

  To select modeling notation preferences

  Working with IDEF1X and IE Notation

  Setting ERwin Diagram Preferences


To select modeling notation preferences

1.	Choose Preferences on the Option menu.

2.	Click the Methodology tab.

3.	Choose one of the following options in the Logical Notation group box:

•	To use IDEF1X notation for logical modeling, click the IDEF1X button.

•	To use IE notation for logical modeling, click the IE button.

4.	Choose one of the following options in the Physical Notation group box:

•	To use IDEF1X notation for physical modeling, click the IDEF1X button.

•	To use IE notation for physical modeling, click the IE button.

•	To use DM notation for physical modeling, click the DM button.

5.	If you select DM notation for physical modeling, choose whether or not to display warnings when relationships and dimensional modeling roles violate dimensional modeling standards.

•	To display conformance warnings, select the Display conformance warnings check box.

•	To suppress conformance warnings, clear the Display conformance warnings check box.

6.	Click OK.

Hint:	Click Apply to save the preferences before moving to a different tab.


Selecting Display Option Preferences

You can use the Display Options tab in the Preferences dialog to control how some objects display in your diagrams. For example, if you choose to enhance your diagrams with a shadow effect, you can set the shadow offset for entities, tables, and views. You can also specify how much of a view column expression is displayed in the physical model, how many characters the entity definition and comment text should display per line, how ERwin lays out each relationship line, and how ERwin places verb phrases on each relationship line.

The purpose of each control in the Display Options tab is explained below.

•	Shadow Offset . Specify the width for entity and table shadows (in pixels).

•	Right. Type a value to specify the shadow to the right of each entity, table, or view in your diagram. The default offset for the right shadow is 5.

•	Bottom. Type a value to specify the shadow below each entity, table, or view in your diagram. The default offset for the bottom shadow is 5.

•	Maximum Display Length. Specify the number of characters per line.

•	View Expression. Type a value to specify how much of a view column expression is displayed in the physical model. The default maximum view expression length is 20.

•	Definition/Comment. Type a value to specify the maximum number of characters displayed for Entity Definitions and Table Comments before text is wrapped to the next line. The default maximum Definition/Comment length is 30.

•	Relationship Line Layout. Select the layout for relationship lines.

•	Allow Auto Layout Only. Select this check box to let ERwin automatically adjust all relationship lines in your diagram. Clear this check box so that you can manually adjust the relationship lines.

•	Reset to Automatic. Click this button to let ERwin automatically reset the position of each relationship line in your diagram.

•	Split Verb Phrase. Select this check box to let ERwin split the parent-to-child and child-to-parent verb phrases on each relationship line.

•	Display Verb Phrases. Specify the parts of the relationship verb phrase to display.

•	Parent-to-Child Only. Click this button to display only the parent-to-child verb phrase for relationships.

•	Child-to-Parent Only. Click this button to display only the child-to-parent verb phrase for relationships.

•	Both. Click this button to display both the parent-to-child and child-to-parent verb phrases for relationships.

Related Topics

  Adding the Shadow Effect

  Specifying View Columns Using the View Editor

  Adding Verb Phrases to Relationships

  To select display option preferences

  Setting ERwin Diagram Preferences


To select display option preferences

1.	Choose Preferences on the Option menu.

2.	Click the Display Options tab.

3.	Choose any of the following options in the Shadow Offset group box:

•	To specify a shadow to the right of each entity, table, or view in your diagram, type a value in the Right box.

•	To specify a shadow below each entity, table, or view in your diagram, type a value in the Bottom box.

4.	To specify how much of a view column expression is displayed in your diagram, type a value in the View Expression box.

5.	To specify the maximum number of characters displayed for entity Definitions and Comments before text is wrapped to the next line, type a value in the Definition/Comment box.

6.	Choose any of the following options in the Relationship Line Layout Options group box:

•	To let ERwin automatically adjust the relationship lines in your diagram, select the Allow Auto Layout Only check box. Clear this check box so that you can manually adjust the relationship lines.

•	To let ERwin automatically reset the position of each relationship line in your diagram, click the Reset to Automatic button.

•	To let ERwin split the parent-to-child and child-to-parent verb phrases on each relationship line, select the Split Verb Phrase check box.

7.	Choose one of the following options in the Display Verb Phrases group box:

•	To display only the parent-to-child verb phrase for relationships, click the Parent-to-Child Only button.

•	To display only the child-to-parent verb phrase for relationships, click the Child-to-Parent Only button.

•	To display both the parent-to-child and child-to-parent verb phrases for relationships, click the Both button.

8.	Click OK.

Hint:	Click Apply to save the preferences before moving to a different tab.


Enforcing Unique Names

As you design your diagrams, you may need to make sure that you assign a unique name to each entity, table, view, attribute, or column. If you assign the same name to two or more objects, it can quickly lead to design problems, and it can produce errors when you run queries to extract particular sets of data. For this reason, you can use ERwin to enforce unique names.

Note:	If you select a unique name option, ERwin does not enforce the unique name rules for existing duplicate names or for attribute and column names derived from domain inheritance. See Independent Attributes and Independent Columns for more information.

Choose Unique Name on the Option menu to open the Unique Name Option dialog.

The purpose of each control in the Unique Name Option dialog is explained below:

•	Allow. Click this button to accept the duplicate name without changing it. This is the initial ERwin default setting.

•	Rename. Click this button to accept the duplicate name, but append a forward-slash and number (for example, MOVIE-COPY/2) after the name. The forward-slash indicates that the name has been previously used in the diagram, and the number indicates how many times it has been used.

•	Ask. Click this button to have ERwin inform you that a duplicate name exists, and either type a replacement name or accept the duplicate. Replacement names are not checked for uniqueness.

•	Disallow. Click this button to prohibit the entry of duplicate names. You cannot type them using the editors or diagram editing. If a duplicate name is recognized, ERwin displays a message box stating that the non-unique name is disallowed and the duplicate is deleted.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To control how ERwin handles duplicate names

  Using the Entity Editor

  Using the Attribute Editor

  Using the Table Editor

  Using the Column Editor

  Using the View Editor


To control how ERwin handles duplicate names

1.	Choose Unique Name on the Option menu.

2.	Choose one of the following options:

•	To accept the duplicate name, but append a forward-slash and number after the name, click the Rename button.

•	To permit duplicate names without changing it, click the Allow button.

•	To prohibit the entry of duplicate names, click the Disallow button.

•	To have ERwin inform you that a duplicate name exists, click the Ask button. You can type a new name or accept the duplicate name.

3.	Click OK.


Changing Logical Display Levels

ERwin provides you with five different display levels to view the logical information about a data model. These levels are useful for showing different types of information in the logical model.

•	Entity

•	Attribute

•	Primary Key

•	Definition

•	Icon

Note:	You can set logical display levels differently in each stored display that you create. See Working with Stored Displays for more information.

Related Topics

  Changing Physical Display Levels


Entity Display Level

You use the Entity Display Level to display the name of each entity in a data model inside an entity box. No other information is displayed for the entity.

Related Topics

  To display a diagram in the Entity Display Level

  Creating an Entity

  Table Display Level

  Changing Logical Display Levels


To display a diagram in the Entity Display Level

•	Click [image] on the ERwin toolbar.

Note:	Click a different display level button on the ERwin toolbar to hide the Entity Display Level.


Attribute Display Level

You use the Attribute Display Level to display the attributes for each entity in a data model, with the primary key attributes above the line and the non-key attributes below the line in an entity box.

Related Topics

  To display a diagram in the Attribute Display Level

  Using the Attribute Editor

  Column Display Level

  Changing Logical Display Levels


To display a diagram in the Attribute Display Level

•	Click [image] on the ERwin toolbar.

Note:	Click a different display level button on the ERwin toolbar to hide the Attribute Display Level.


Primary Key Display Level (Logical)

You use the Primary Key Display Level to display only the primary key attributes (those found above the line in an entity box) for each entity in a data model.

Related Topics

  To display a diagram in the Primary Key Display Level

  Using the Key Group Editor

  Primary Key Display Level (Physical)

  Changing Logical Display Levels


To display a diagram in the Primary Key Display Level

•	Right-click on a blank area of the diagram, then choose Primary Key on the Display Level submenu.

Note:	Click a different display level button on the ERwin toolbar to hide the Primary Key Display Level.


Definition Display Level

You use the Definition Display Level to display a definition for each entity in a data model.

Related Topics

  To display a diagram in the Definition Display Level

  Entering an Entity Definition

  Comment Display Level

  Changing Logical Display Levels


To display a diagram in the Definition Display Level

•	Click [image] on the ERwin toolbar.

Note:	Click a different display level button on the ERwin toolbar to hide the Definition Display Level.


Icon Display Level

You use the Icon Display Level to display the bitmap assigned to each entity in a data model. The displayed bitmap is the large icon bitmap you assign when you attach icons to entities. See Attaching an Icon to an Entity for more information.

Related Topics

  To display a diagram in the Icon Display Level

  Changing Logical Display Levels


To display a diagram in the Icon Display Level

•	Right-click on a blank area of the diagram, then choose Icon on the Display Level submenu.

Note:	Click a different display level button on the ERwin toolbar to hide the Icon Display Level.


Changing Logical Display Options

ERwin provides you with two different display options to view the logical information about a data model. These options are useful for showing different types of information in the logical model.

•	Entity Display Options

•	Relationship Display Options

Related Topics

  Changing Physical Display Options

  Changing Logical Display Levels


Entity Display Options

There are eight display options that you can use to view the logical information about the entities in a data model, including:

•	Rolename/Attribute

•	Logical Datatype/Domain

•	Primary Key Designator

•	Foreign Key Designator (FK)

•	Alternate Key Designator (AK)

•	Attribute Icon

•	Entity Icon

•	Show Migrated Attributes

Note:	You can set entity display options differently in each stored display that you create. See Working with Stored Displays for more information.

Related Topics

  Table Display Options


Rolename/Attribute Display Option

You use the Rolename/Attribute Display Option to display rolenames and the basenames for the attributes in an entity. The basename is the attribute name that is migrated from the parent entity to the child entity. ERwin inserts a period after the rolename and then appends the attribute's basename.

You assign the rolename to the foreign key attribute using the Relationship Editor in the logical model. ERwin displays the rolename as the foreign key.

Related Topics

  To display rolenames and basenames

  Defining Attribute Rolenames

  Changing Logical Display Options


To display rolenames and basenames

•	Right-click on a blank area of the diagram, then choose Rolename/Attribute on the Display Options/Entities submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Entities submenu.


Logical Datatype/Domain Display Option

You use the Logical Datatype/Domain Display Option to display the logical datatype and domain for the attributes in a data model.

Related Topics

  To display logical datatypes and domains

  Attaching a Domain to an Attribute

  Column Domain Display Option

  Changing Logical Display Options


To display logical datatypes and domains

•	Right-click on a blank area of the diagram, then choose Logical Datatype/Domain on the Display Options/Entities submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Entities submenu.


Primary Key Designator Display Option (Logical)

You use the Primary Key Designator Display Option to display the primary key designator ( [image]) for the attributes in an entity.

Note:	This option is not available when you display Attribute icons. To display the primary key designator, hide Attribute icons and choose the Primary Key Designator option.

Related Topics

  To display primary key designators in the logical model

  Changing Logical Display Options


To display primary key designators in the logical model

1.	Right-click on a blank area of the diagram, then choose the Display Options/Entities on the submenu.

2.	If the Primary Key Designator option is available on the submenu, select it to display the primary key designator ( [image]).

3.	If the Primary Key Designator option is not available, hide the Attribute Icon by choosing the Attribute Icon option on the Display Options/Entities submenu. Then choose the Primary Key Designator option on the Display Display Options/Entities submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Entities submenu.


Foreign Key Designator Display Option (Logical)

You use the Foreign Key Designator (FK) Display Option to display the foreign key designator (FK) for the attributes in an entity.

Related Topics

  To display foreign keys in the logical model

  Assigning Key Group Membership in the Attribute Editor

  Foreign Key Designator Display Option (Physical)

  Changing Logical Display Options


To display foreign keys in the logical model

•	Right-click on a blank area of the diagram, then choose Foreign Key Designator (FK) on the Display Options/Entities submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Entities submenu.


Alternate Key Designator Display Option (Logical)

You use the Alternate Key Designator (AK) Display Option to display the alternate key (AK) designator and inversion entry (IE) designator for the attributes in an entity. The Alternate Key Designator (AK) Display Option displays extended notation to show the order of concatenation as defined in the Key Group Editor.

In the example above, the extended notation for customer name (AK1.1) and for customer phone (AK1.2) indicate that customer name is concatenated before customer phone in the CUSTOMER entity. The extended notation for customer id (IE1.1) indicates that customer id is the first member of the inversion entry in the CUSTOMER entity.

Related Topics

  To display alternate keys in the logical model

  Assigning Key Group Membership in the Attribute Editor

  Alternate Key Designator Display Option (Physical)

  Changing Logical Display Options


To display alternate keys in the logical model

•	Right-click on a blank area of the diagram, then choose Alternate Key Designator (AK) on the Display Options/Entities submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Entities submenu.


Attribute Icon Display Option

You use the Attribute Icon Display Option to display the icons for the attributes in an entity. This makes the diagram much easier to view with respect to the datatypes that are used by each attribute.

Note:	This option is not available when you display primary key designators. To display the Attribute icons, hide primary key designators and choose the Attribute Icon option.

Related Topics

  To display attribute icons

  Changing Logical Display Options


To display attribute icons

•	Right-click on a blank area of the diagram, then choose Attribute Icon on the Display Options/Entities submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Entities submenu.


Entity Icon Display Option

You use the Entity Icon Display Option to display the entity icon next to the entity name in a logical data model. The icon is the small icon bitmap you assign when you attach icons to entities. See Attaching an Icon to an Entity for more information.

Related Topics

  To display small entity icons

  Changing Logical Display Options


To display small entity icons

•	Right-click on a blank area of the diagram, then choose Entity Icon on the Display Options/Entities submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Entities submenu.


Show Migrated Attributes Display Option

You use the Show Migrated Attributes Display Option to display the primary key attributes that have migrated to associated foreign key attributes.

Related Topics

  To display migrated attributes

  Changing Logical Display Options


To display migrated attributes

•	Right-click on a blank area of the diagram, then choose Show Migrated Attributes on the Display Options/Entities submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Entities submenu.


Relationship Display Options

There are three display options that you can use to view the logical information about the relationships in a data model, including:

•	Verb Phrase

•	Cardinality

•	Referential Integrity

Note:	You can set relationship display options differently in each stored display that you create. See Working with Stored Displays for more information.

Related Topics

  Relationship Display Options (Physical)

  Changing Logical Display Options


Verb Phrase Display Option

You use the Verb Phrase Display Option to display verb phrases for the relationships in a data model.

Related Topics

  To display verb phrases in the logical model

  Adding Verb Phrases to Relationships

  Selecting Display Option Preferences

  Foreign Key Constraint Name Display Option


To display verb phrases in the logical model

Right-click on a blank area of the diagram, then choose Verb Phrase on the Display Options/Relationships submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Relationships submenu.


Cardinality Display Option (Logical)

You use the Cardinality Display Option to display cardinality symbols for the relationships in a data model.

Related Topics

  To display cardinality in the logical model

  Setting Relationship Cardinality

  Cardinality Display Option (Physical)

  Changing Logical Display Options


To display cardinality in the logical model

•	Right-click on a blank area of the diagram, then choose Cardinality on the Display Options/Relationships submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Relationships submenu.


Referential Integrity Display Option (Logical)

You use the Referential Integrity Display Option to display referential integrity symbols for the relationships in a data model.

Related Topics

  To display referential integrity in the logical model

  Defining Referential Integrity Trigger Actions

  Referential Integrity Display Option (Physical)

  Changing Logical Display Options


To display referential integrity in the logical model

•	Right-click on a blank area of the diagram, then choose Referential Integrity on the Display Options/Relationships submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Relationships submenu.


Changing Physical Display Levels

ERwin provides you with five different display levels to view the physical information about a data model. These levels are useful for showing different types of information in the physical model.

•	Table

•	Column

•	Primary Key

•	Comment

•	Physical Order

•	Collapse Fact Display Level

•	Collapse Dimension Display Level

Note:	You can set physical display levels differently in each stored display that you create. See Working with Stored Displays for more information.

Related Topics

  Changing Logical Display Levels


Table Display Level

You use the Table Display Level to display the name of each table in the data model. No other table information is displayed for the table.

Related Topics

  To display a diagram in the Table Display Level

  Creating a Table

  Entity Display Level

  Changing Physical Display Levels


To display a diagram in the Table Display Level

•	Right-click on a blank area of the diagram, then choose Table on the Display Level submenu.

Note:	Click a different display level button on the ERwin toolbar to hide the Table Display Level.


Column Display Level

You use the Column Display Level to display the columns for each table in a data model, with the primary key columns above the line and the non-key columns below the line in a table box.

Related Topics

  To display a diagram in the Column Display Level

  Using the Column Editor

  Changing Physical Display Levels


To display a diagram in the Column Display Level

•	Right-click on a blank area of the diagram, then choose Column on the Display Level submenu.

Note:	Click a different display level button on the ERwin toolbar to hide the Column Display Level.


Primary Key Display Level (Physical)

You use the Primary Key Display Level to display the primary keys (those found above the line in a table box) for each table in the data model. The columns below the line are hidden, but display when you switch back to the Column Datatype Display level.

Related Topics

  To display a diagram in the Primary Key Display Level

  Attaching a Domain to a Column

  Primary Key Display Level (Logical)

  Changing Physical Display Levels


To display a diagram in the Primary Key Display Level

•	Right-click on a blank area of the diagram, then choose Primary Key on the Display Level submenu.

Note:	Click a different display level button on the ERwin toolbar to hide the Primary Key Display Level.


Comment Display Level

You use the Comment Display Level to display a comment for each table in the data model.

Related Topics

  To display a diagram in the Comment Display Level

  Specifying a Table Comment

  Definition Display Level

  Changing Physical Display Levels


To display a diagram in the Comment Display Level

•	Right-click on a blank area of the diagram, then choose Comment on the Display Level submenu.

Note:	Click a different display level button on the ERwin toolbar to hide the Comment Display Level.


Physical Order Display Level

You can use the Physical Order Display Level to display the order in which each column appears in the corresponding table.

Related Topics

  To display a diagram in the Physical Order Display Level

  Using the Column Editor

  Changing Physical Display Levels


To display a diagram in the Physical Order Display Level

•	Right-click on a blank area of the diagram, then choose Physical Order on the Display Level submenu.

Note:	Click a different display level button on the ERwin toolbar to hide the Physical Order Display Level.


Collapse Fact Display Level

You can use the Collapse Fact Display Level to hide the columns in the fact tables in your dimensional model. This menu option is only available when you select DM (Dimensional Modeling) notation for your physical model.

Related Topics

  Changing Physical Display Levels

  To collapse the fact tables

  Collapse Dimension Display Level


To collapse the fact tables

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Right-click on a blank area of the diagram, then choose Collapse Fact on the Display Level submenu to hide the columns in the fact tables.

Note:	Click a different display level button on the ERwin toolbar to display the columns in the fact tables.


To collapse the dimension tables

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Right-click on a blank area of the diagram, then choose Collapse Dimension on the Display Level submenu to hide the columns in the dimension and outrigger tables.

Note:	Click a different display level button on the ERwin toolbar to display the columns in the dimension and outrigger tables.


Collapse Dimension Display Level

You can use the Collapse Fact Display Level to hide the columns in the dimension and outrigger tables in your dimensional model. This menu option is only available when you select DM (Dimensional Modeling) notation for your physical model.

Related Topics

  Changing Physical Display Levels

  To collapse the dimension tables

  Collapse Fact Display Level


Changing Physical Display Options

ERwin provides you with three different display options to view the physical information about a data model. These levels are useful for showing different types of information in the physical model.

•	Table Display Options

•	View Display Options

•	Relationship Display Options

Related Topics

  Changing Logical Display Options


Table Display Options

There are eight display options that you can use to view the physical information about the tables in a data model, including:

•	Column Datatype

•	Column Domain

•	Null Option

•	Primary Key Designator Display Option

•	Foreign Key Designator (FK)

•	Alternate Key Designator (AK)

•	Dimensional Icon

•	Table Owner

•	Table Owner Using User

•	Ungenerated Tables

Note:	You can set table display options differently in each stored display that you create. See Working with Stored Displays for more information.

Related Topics

  Entity Display Options

  Changing Physical Display Options


Column Datatype Display Option

You use the Column Datatype Display Option to display the physical datatype for each column in a table.

Related Topics

  To display column datatypes

  Using the Column Editor

  Setting Database-Specific Column Properties

  Logical Datatype/Domain Display Option

  Changing Physical Display Options


To display column datatypes

•	Right-click on a blank area of the diagram, then choose Column Datatype on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


Column Domain Display Option

You use the Column Domain Display Option to display the domain for each column in a table. The Column Domain Display Option is available only when the Column Datatype Display Option is selected.

Related Topics

  To display column domains

  Attaching a Domain to a Column

  Logical Datatype/Domain Display Option

  Changing Physical Display Options


To display column domains

•	Right-click on a blank area of the diagram, then choose Column Domain on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


Null Display Option

You use the Null Display Option to display NULL or NOT NULL values for each column in a table.

Related Topics

  To display column nulls

  Setting Database-Specific Column Properties

  Changing Physical Display Options


To display column nulls

•	Right-click on a blank area of the diagram, then choose Null Option on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


Primary Key Designator Display Option (Physical)

You use the Primary Key Designator Display Option to display the primary key designator ( [image]) for the attributes in an entity.

Related Topics

  To display primary key designators in the physical model

  Changing Physical Display Options


To display primary key designators in the physical model

•	Right-click on a blank area of the diagram, then choose the Primary Key Designator option on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


Foreign Key Designator Display Option (Physical)

You use the Foreign Key Designator (FK) Display Option to display the foreign key designator (FK) for migrated columns in the diagram.

Related Topics

  To display foreign keys in the physical model

  Migrating Column Properties

  Foreign Key Designator Display Option (Logical)

  Changing Physical Display Options


To display foreign keys in the physical model

•	Right-click on a blank area of the diagram, then choose Foreign Key Designator (FK) on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


Alternate Key Designator Display Option (Physical)

You use the Alternate Key Designator (AK) Display Option to display the alternate key (AK) and inversion entry (IE) designator for the columns in a table. The Alternate Key Designator (AK) Display Option displays extended notation to show the order of concatenation as defined in the Index Editor.

In the example above, the extended notation for customer_name (AK1.1) and for customer_phone (AK1.2) indicate that customer_name is concatenated before customer_phone in the CUSTOMER table. The extended notation for customer_id (IE1.1) indicates that customer_id is the first member of the inversion entry in the CUSTOMER table.

Related Topics

  To display alternate keys in the physical model

  Using the Column Editor

  Alternate Key Designator Display Option (Logical)

  Changing Physical Display Options


To display alternate keys in the physical model

•	Right-click on a blank area of the diagram, then choose Alternate Key Designator (AK) on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


Dimensional Icon Display Option

You use the Dimensional Icon display option to display the dimensional icons used in dimensional modeling. This option is only available when you select DM (Dimensional Modeling) notation for your physical model.

When in a dimensional model, the role icons display before the table name and indicate the table’s dimensional modeling role:

	fact table
	dimension table
	outrigger table
Related Topics

  To display dimensional icons in the physical model

  Specifying Dimensional Modeling Table Options

  To assign a dimensional modeling role


To display dimensional icons in the physical model

•	Right-click on a blank area of the diagram, then choose Dimensional Icon on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


Table Owner Display Option

You use the Table Owner Display Option to display the name of the person who owns a table as a prefix to the table name. The naming convention that ERwin uses is TABLEOWNER.TABLENAME.

Related Topics

  To display table owners

  Using the Table Editor

  Changing Physical Display Options


To display table owners

•	Right-click on a blank area of the diagram, then choose Table Owner on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


Table Owner Using User Display Option

You use the Table Owner Using User Display Option to hide the table owner information from the table owner. The naming convention that ERwin uses is TABLEOWNER.TABLENAME.

In the figure above, if you are logged onto the target server and connected to the database system catalog, you own the PRODUCT and ORDER tables which do not display an owner name. The CUSTOMER and EMPLOYEE tables are owned by user “DBA”.

Related Topics

  To display table owners using user

  Changing Physical Display Options


To display table owners using user

•	Right-click on a blank area of the diagram, then choose Table Owner using User on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


Ungenerated Tables Display Option

You use the Ungenerated Table Display Option to display tables that will not be generated when you generate the schema. ERwin generates a table only when you select the Generate check box in the Table Editor.

Related Topics

  To display ungenerated tables

  Forward Engineering/Generating a Database Schema

  Using the Table Editor

  Changing Physical Display Options


To display ungenerated tables

•	Right-click on a blank area of the diagram, then choose Ungenerated Tables on the Display Options/Tables submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Tables submenu.


View Display Options

There are five display options that you can use to view the physical information about the views in a data model, including:

•	Views

•	View Relations

•	Column Alias

•	Column Datatype

•	Column Null Option

Note:	You can set view display options differently in each stored display that you create. See Working with Stored Displays for more information.

Related Topics:

  Changing Physical Display Options


Views Display Option

You use the Views Display Option to display the views in a data model. When you select the Views Display Option, the remaining view display options are available.

Related Topics

  To display views

  Working with Views


To display views

•	Right-click on a blank area of the diagram, then choose Views on the Display Options/Views submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Views submenu.


View Relations Display Option

You use the View Relations Display Option to display relationship lines for views in a data model.

Related Topics

  To display view relations

  How ERwin Represents Views

  To create a view relationship

  Changing Physical Display Options


To display view relations

•	Right-click on a blank area of the diagram, then choose View Relations on the Display Options/Views submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Views submenu.


Column Alias Display Option

You use the View Column Alias Display Option to display the source table alias name for views in a data model.

Related Topics

  To display the source table alias name for views

  Selecting the Source Tables for a View

  To specify an alias for a view source table

  Changing Physical Display Options


To display the source table alias name for views

•	Right-click on a blank area of the diagram, then choose View Column Alias on the Display Options/Views submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Views submenu.


Column Datatype Display Option (View)

You use the View Column Datatype Display Option to display the physical datatype for columns in a view.

Related Topics

  To display the physical datatype for columns in a view

  Changing Physical Display Options


To display the physical datatype for columns in a view

•	Right-click on a blank area of the diagram, then choose View Column Datatype on the Display Options/Views submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Views submenu.


Column Null Option Display Option (View)

You use the View Column Null Option Display Option to display NULL or NOT NULL values for each column in a view.

Related Topics

  To display null options for views

  Changing Physical Display Options


To display null options for views

•	Right-click on a blank area of the diagram, then choose View Column Null Option on the Display Options/Views submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Views submenu.


Relationship Display Options

There are three display options that you can use to view the physical information about the relationships in a data model, including:

•	Foreign Key Constraint Name

•	Cardinality

•	Referential Integrity

Note:	You can set relationship display options differently in each stored display that you create. See Working with Stored Displays for more information.

Related Topics

  Relationship Display Options (Logical)

  Changing Physical Display Options


Foreign Key Constraint Name Display Option

You use the Foreign Key Constraint Name Display Option to display the foreign key constraint name for relationships in a data model.

Related Topics

  To display the foreign key constraint name

  Adding the Foreign Key Name

  Selecting Display Option Preferences

  Verb Phrase Display Option (Logical)

  Changing Physical Display Options


To display the foreign key constraint name

•	Right-click on a blank area of the diagram, then choose Foreign Key Constraint Name on the Display Options/Relationships submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Relationships submenu.


Cardinality Display Option (Physical)

You use the Cardinality Display Option to display cardinality symbols for the relationships in a data model.

Related Topics

  To display cardinality in the physical model

  Setting Relationship Cardinality

  Cardinality Display Option (Logical)

  Changing Physical Display Options


To display cardinality in the physical model

•	Right-click on a blank area of the diagram, then choose Cardinality on the Display Options/Relationships submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Relationships submenu.


Referential Integrity Display Option (Physical)

You use the Referential Integrity Display Option to display referential integrity symbols for the relationships in a data model.

Related Topics

  To display referential integrity in the physical model

  Defining Referential Integrity Trigger Actions

  Referential Integrity Display Option (Logical)

  Changing Physical Display Options


To display referential integrity in the physical model

•	Right-click on a blank area of the diagram, then choose Referential Integrity on the Display Options/Relationships submenu.

Note:	You can use multiple display options for a diagram by selecting each option on the Display Options/Relationships submenu.


Changing the Diagram Magnification Level

You can use the Zoom options on the ERwin Toolbar to view a data model at different magnification levels. The following zoom options are on the ERwin toolbar:

•	  Increases the magnification of your model in increments of 25 percent.

•	  Decreases the magnification of your model in increments of 25 percent.

•	  Resets the magnification level to 100 percent.

•	  Reduces the magnification level to fit the entire diagram in the diagram window.

•	  You can select a specific area of the diagram to feature.

Note:	ERwin manages display magnification independently from print magnification. When you print a diagram, ERwin ignores the zoom display settings and allows you to change the scale of the diagram to show more or less of the diagram on each page. See Adjusting Page Boundaries for more information.

Related Topics

  To increase or decrease the diagram magnification level

  To fit the data model in the diagram window

  To feature part of a data model


To increase or decrease the diagram magnification level

•	To enlarge your diagram in increments of 25 percent, click [image].

•	To reduce your diagram in increments of 25 percent, click [image].

Hint:	Press CTRL+ (plus sign) to increase magnification, CTRL- (minus sign) to decrease magnification, or CTRL* (asterisk) to reset magnification to 100 percent.


To fit the data model in the diagram window

•	Click [image].


To feature part of a data model

1.	Click [image] to display the magnifying glass tool.

2.	Lasso the area you want to feature. ERwin applies the appropriate Zoom level to the model and fills the diagram window with the selected portion.

Note:	The area that you want to feature can be smaller or larger than the current display.


Adding the Shadow Effect

You can add a 3-dimentional shadow effect to the entities in the logical model and the tables or views in the physical model. You use this display preference to enhance the appearance of your model. You can use the Shadow Offset option in the Preferences dialog to change the bottom and right shadow offset dimensions to make the shadows larger or smaller.

Related Topics

  To add the shadow effect to entities and tables

  Selecting Display Option Preferences


To add the shadow effect to entities, tables, and views

•	Right-click on a blank area of the diagram, then choose Display Shadow on the submenu.

Note:	Clear the Display Shadow option on the shortcut menu to hide the shadow effect.


Working with Relationships in the Logical Model

A relationship is used in an ERwin logical data model to show that there is an association or link between two entities, or between an entity and itself. You can use ERwin's logical modeling features to create these five types of relationships:

•	Identifying relationship

•	Non-identifying relationship

•	Subtype relationship

•	Many-to-many relationship

•	Recursive relationship

Each relationship can visually depict seven pieces of information:

•	Type of relationship

•	Parent end of relationship

•	Child end of relationship

•	Optional symbol (only for non-identifying relationships)

•	Referential integrity

•	Verb phrase

•	Cardinality

Relationships are used in both the logical and physical models, and can be represented in either model as one or more foreign key attributes. See Working with Relationships in the Physical Model for more information.

When you create a relationship, ERwin labels the relationship R_n, where R stands for relationship, and n is a unique number. ERwin assigns each number only once per model, and calculates new relationship numbers beginning with the number zero.

Related Topics

  Creating a Relationship in the Logical Model

  Using the Relationship Tools in the Logical Model

  Using the Relationship Editor in the Logical Model

  Navigating a Model Using Relationships

  Unifying Relationships

  Foreign Key Migration

  Deleting a Relationship


Creating a Relationship in the Logical Model

Identifying, non-identifying, subtype, many-to-many, and recursive relationships can be created in ERwin through:

•	Using the Relationship Tools

•	Reverse engineering an existing database. See Reverse Engineering from a DDL Script or Database for more information.


Using the Relationship Tools in the Logical Model

ERwin includes four tools in the ERwin toolbox for creating identifying, non-identifying, subtype, many-to-many, and recursive relationships, as shown below.

Related Topics

  Creating an Identifying Relationship

  Creating a Non-Identifying Relationship

  Creating a Subtype Relationship

  Creating a Many-to-Many Relationship

  Creating a Recursive Relationship


Creating an Identifying Relationship in the Logical Model

An identifying relationship is a relationship between two entities in which an instance of a child entity is identified through its association with a parent entity, which means the child entity is dependent on the parent entity for its identify and cannot exist without it. In an identifying relationship, one instance of the parent entity is related to multiple instances of the child.

ERwin draws, in IDEF1X notation, an identifying relationship line as a solid line with a diamond or a filled circle at either end of the line. ERwin draws, in IE notation, an identifying relationship line as a solid line with crows feet.

Note:	ERwin automatically migrates primary key attributes from a parent entity to a child entity, so you do not need to enter any foreign keys in the child.

Related Topics

  To create an identifying relationship in the logical model

  Navigating a Model Using Relationships

  Unifying Relationships

  Foreign Key Migration

  Relationship and Cardinality Symbols


To create an identifying relationship in the logical model

1.	Click [image] in the ERwin toolbox. The cursor changes to [image].

2.	Click on the parent entity, then click on the child entity.

Note:	ERwin automatically migrates primary key attributes from a parent entity to a child entity, so you do not need to enter any foreign keys in the child.


Creating a Non-Identifying Relationship in the Logical Model

A non-identifying relationship is a relationship between two entities in which an instance of the child entity is not identified through its association with a parent entity, which means the child entity is not dependent on the parent entity for its identify and can exist without it. In a non-identifying relationship, one instance of the parent entity is related to multiple instances of the child.

You can use ERwin to create these two types of non-identifying relationships:

•	Optional non-identifying relationship

•	Mandatory non-identifying relationship

You can also use non-identifying relationships to create recursive relationships.

Note:	ERwin automatically migrates primary key attributes from a parent entity to a child entity, so you do not need to enter any foreign keys in the child.

Related Topics

  To create a non-identifying relationship in the logical model

  Creating a Recursive Relationship

  Navigating a Model Using Relationships

  Unifying Relationships

  Foreign Key Migration

  Relationship and Cardinality Symbols


Optional Non-identifying Relationship (Logical)

In an optional non-identifying relationship, the attributes that are migrated into the non-key area of the child entity are not required in the child entity. This means that nulls are allowed in the foreign key. ERwin draws an optional non-identifying relationship differently depending on the notation for your diagram:

•	IDEF1X notation draws a dashed line with a solid dot on the child end and a diamond on the parent end.

•	IE notation draws a dashed line with a cross and a circle on the parent end. The child end indicates the cardinality with:

•	crows feet with a cross and a circle, as shown below (Zero, one or more)

•	crows feet with a cross (One or more)

•	a cross and a circle (Zero or one)

•	a dashed line (Exactly n)

IDEF1X Notation	IE Notation

Related Topics

  Relationship and Cardinality Symbols

  Optional Non-Identifying Relationship (Physical)


Mandatory Non-Identifying Relationship (Logical)

In a mandatory non-identifying relationship, the attributes that are migrated into the non-key area of the child entity are required in the child entity. This means that the foreign key cannot be null. ERwin draws a mandatory non-identifying relationship differently depending on the notation for your diagram:

•	IDEF1X notation draws a dashed line with a solid dot on the child end.

•	IE notation draws a dashed line with a cross on the parent end. The child end indicates the cardinality with:

•	crows feet with a cross and a circle, as shown below (Zero, one or more)

•	crows feet with a cross (One or more)

•	a cross and a circle (Zero or one)

•	a dashed line (Exactly n)

IDEF1X Notation	IE Notation

Related Topics

  Relationship and Cardinality Symbols

  Mandatory Non-Identifying Relationship (Physical)


To create a non-identifying relationship in the logical model

1.	Click [image] in the ERwin toolbox. The cursor changes to [image].

2.	Click on the parent entity, then click on the child entity.

Note:	ERwin automatically migrates primary key attributes from a parent entity to a child entity, so you do not need to enter any foreign keys in the child. ERwin also automatically creates the relationship with nulls allowed in the parent. To create a mandatory non-identifying relationship, select No Nulls in the Relationship Editor. See To change the null option for a relationship for more information.


Creating a Subtype Relationship

When you analyze the entities in your data model, you might have some entities that define an entire type, or classification of a particular item. For example, employees can be full-time and part time. For each type of employee, some of the information is the same, and some is different.

In an ERwin data model, you can show that full time and part time employees are part of a larger category, EMPLOYEE, by creating a subtype relationship. A subtype relationship connects an entity that defines the category and two or more additional entities that define each of the elements of the category. The parent entity of the category is considered the supertype and each child entity is considered a subtype.

You can use ERwin to create these four types of subtype relationships:

•	Complete subtype relationship (in IDEF1X,when all categories are known).

•	Incomplete subtype relationship (in IDEF1X, when all categories may not be known).

•	Inclusive subtype relationship (in IE, when an attribute in the subtype entity can derive its value from one or more subtype entities).

•	Exclusive subtype relationship (in IE, when an attribute in the subtype entity can derive its value from only one subtype entity).

You also use ERwin to add a verb phrase for the subtype relationships in your diagram. You use a discriminator as the verb phrase for a subtype relationship.

Related Topics

  To create a complete subtype relationship

  To create an incomplete subtype relationship

  To create an inclusive subtype relationship

  To create an exclusive subtype relationship

  To assign a discriminator to a subtype relationship

  Navigating a Model Using Relationships

  Unifying Relationships

  Foreign Key Migration

  Subtype Relationships Using IE Notation


To create a complete subtype relationship

1.	Click [image] in the ERwin toolbox. The cursor changes to [image].

2.	Click on the parent entity in the relationship, then click on the first child entity. ERwin creates the relationship.

3.	Click on the [image] symbol in your diagram, then click on a child entity to add it as a subtype.

4.	Repeat step 3 for each child entity that you want to add as a subtype.


To create an incomplete subtype relationship

1.	Click [image] in the ERwin toolbox. The cursor changes to [image].

2.	Click on the parent entity in the relationship, then click on the first child entity. ERwin creates the relationship.

3.	Click on the [image] symbol in your diagram, then click on a child entity to add it as a subtype.

4.	Repeat step 3 for each child that you want to add as a subtype.

5.	Right-click on the [image] symbol, then choose Subtype Relationship Editor on the shortcut menu.

6.	Click the Incomplete button to create an incomplete subtype relationship.

7.	Click OK.


To create an inclusive subtype relationship

1.	Click [image] in the ERwin toolbox. The cursor changes to [image]. More>

2.	Click on the parent entity in the relationship, then click on the first child entity. ERwin creates the relationship.

3.	Click on the [image] symbol in your diagram, then click on a child entity to add it as a subtype.

4.	Repeat step 3 for each child entity that you want to add as a subtype.


To create an exclusive subtype relationship

1.	Click [image] in the ERwin toolbox. The cursor changes to [image]. More>

2.	Click on the parent entity in the relationship, then click on the first child entity. ERwin creates the relationship.

3.	Click on the [image] symbol in your diagram, then click on a child entity to add it as a subtype.

4.	Repeat step 3 for each child that you want to add as a subtype.

5.	Right-click on the [image] symbol, then choose Subtype Relationship Editor on the shortcut menu.

6.	Click the Exclusive button to create an exclusive subtype relationship.

7.	Click OK.


To assign a discriminator to a subtype relationship

1.	Right-click on a subtype relationship, then choose Subtype Relationship Editor on the shortcut menu.

2.	Select the attribute name that you want to assign as the discriminator from the Discriminator Attribute Choice list.

3.	Click OK.

Note:	Select the dashed line ( ) in the Discriminator Attribute Choice list if you do not want to assign a discriminator.


Creating a Many-to-Many Relationship

A many-to-many relationship is a relationship between two entities when each instance of the first entity can be related to many instances in the second entity, and vice versa. ERwin draws, in IDEF1X notation, a many-to-many relationship as a solid line with a solid dot on both the child end and the parent end. ERwin draws, in IE notation, a many-to-many relationship as a solid line with crows feet on both the child end and the parent end.

In the above relationships, <rents> represents the fact that each customer can rent many movies, and <can be rented by> represents the fact that one movie can be rented by many customers.

Related Topics

  To create a many-to-many relationship

  Resolving Many-to-Many Relationships

  Navigating a Model Using Relationships

  Unifying Relationships

  Foreign Key Migration


To create a many-to-many relationship

1.	Click [image] in the ERwin toolbox. The cursor changes to [image].

2.	Click on the parent entity, then click on the child entity.


Resolving Many-to-Many Relationships

If you choose to include many-to-many relationships in the logical model, you might encounter some design problems. For example, you might not be able to track all of the rentals made by a particular customer or to record which copy each customer rents.

To avoid design problems that might be caused by many-to-many relationships, database designers frequently add associative entities that are used as "go-betweens" for two ambiguously related entities. If you insert an associative entity between the two entities involved in a many-to-many relationship, you can change the relationship into a series of one-to-many relationships and use the new relationships to clarify how the data model works.

Also, you can use ERwin to automatically resolve many-to-many relationships. When ERwin resolves a many-to-many relationship, ERwin displays an associative entity in the logical model and also eliminates the many-to-many relationship.

ERwin does not support, and therefore does not display, many-to-many relationships in the physical model. If you create a many-to-many relationship in the logical model and switch to the physical model, ERwin automatically displays the associative table and eliminates the many-to-many relationship. If you then switch back to the logical model, ERwin continues to display the original many-to-many relationship.

Note:	When you select DM (Dimensional Modeling) notation for your physical model, the associative table is a fact table. See Associative Tables in DM Notation for more information.

Related Topics

  To resolve a many-to-many relationship


To resolve a many-to-many relationship

•	Right-click on a many-to-many relationship, then choose Resolve Many To Many on the shortcut menu.


Creating a Recursive Relationship

A recursive relationship is a non-identifying relationship between two entities or tables that represents the fact that one company can own another company. In this type of relationship, the parent entity or table and the child entity or table are the same. You can use ERwin to create these two types of recursive relationships:

•	Hierarchical Recursive (single-table recursion). In this type of relationship, a parent entity or table can have any number of children, but a child can only have one parent.

•	Network Recursive (double-table recursion). In this type of relationship, a parent entity or table can have any number of children, and a child can have any number of parents.

In network recursion, an entity or table has a many-to-many relationship with itself. When a many-to-many network recursion problem exists, you can clarify the situation by creating an intermediate entity or table and converting the many-to-many relationship into two one-to-many relationships. In both types of recursive relationships, rolenames must be assigned to migrating foreign keys to capture the meaning of the recursive relationship. See Defining Attribute Rolenames for more information.

A recursive relationship must be a non-identifying relationship for these reasons:

•	In an identifying relationship, the primary key of the parent would become a subset of the primary key of the child.

•	The key attributes or columns could not have a NULL value.

•	The entity or table would be a parent of itself. The migrated key would perpetually migrate.

Related Topics

  To create a hierarchical recursive relationship

  To create a network recursive relationship

  Defining Attribute Rolenames


To create a hierarchical recursive relationship

1.	Click [image].

2.	Click anywhere on the diagram.

3.	Name the parent entity or table and add the primary and non-key attributes or columns.

4.	Click [image] in the ERwin toolbox. The cursor changes to [image].

5.	Click on the parent entity or table, pause briefly, then click on the entity or table again.

6.	Double-click on the relationship line.

7.	Type a verb phrase to explain the recursive relationship and assign a descriptive rolename to the migrated foreign key attributes or columns based on the relationship.

8.	Click OK.


To create a network recursive relationship

1.	Click [image].

2.	Click anywhere on the diagram.

3.	Name the parent entity or table and add the primary and non-key attributes or columns.

4.	Click [image].

5.	Click anywhere on the diagram.

6.	Name the child entity or table.

7.	Click [image] in the ERwin toolbox. The cursor changes to [image].

8.	Click on the parent entity or table, then click on the child entity or table.

9.	Double-click on the relationship line.

10.	Type a verb phrase to explain the recursive relationship and assign a descriptive rolename to the migrated foreign key attributes or columns based on the relationship.

11.	Click OK.

12.	Repeat steps 4-11 to create a second recursive relationship. Then, assign a descriptive verb phrase to this relationship and an appropriate rolename.


Using the Relationship Editor in the Logical Model

Using the Relationship Editor in the logical model, you can specify the properties of a relationship such as its verb phrase, cardinality, type, and null options. You can also use the Relationship Editor to type a definition, define attribute rolenames, and define referential integrity trigger actions. Right-click on a relationship, then choose Relationship Editor on the shortcut menu to open the Relationship Editor.

The purpose of each control in the Relationship Editor is explained below:

•	Relationship. Displays the currently selected relationship. To view the properties of another relationship, select a different relationship from the list.

•	New. Opens the New Relationship dialog and add a new relationship.

•	Delete. Deletes the selected relationship.

•	Logical Only. Displays the relationship to appear in the logical model only.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The Relationship Editor includes the following tabs:

•	General. Add or edit general information about a relationship.

•	Definition. Add or edit a definition for a relationship.

•	Rolename/RI Actions. Define attribute rolenames and referential integrity actions.

•	UDP. Specify a user-defined property value for the selected relationship.

Related Topics

  To display a relationship in the logical model only


To display a relationship in the logical model only

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select the relationship that you want to appear only in the logical model in the Relationship list.

3.	Select the Logical Only check box.

4.	Click OK.


Specifying General Properties for a Relationship in the Logical Model

You use the controls in the General tab of the Relationship Editor to add and edit the general information about a relationship, including verb phrase, relationship cardinality, relationship type, and null options.

The purpose of each control in the General tab is explained below:

•	Verb Phrase. Type a verb phrase that describes the selected relationship.

•	Parent-to-Child. Type or edit the verb phrase for the parent-to-child relationship.

•	Child-to-Parent. Type or edit the verb phrase for the child-to-parent relationship.

•	Cardinality. Specify the cardinality for the selected relationship.

•	Zero, One or More. Click this button to specify that each parent entity is connected to zero, one, or more instances of the child entity.

•	One or More (P). Click this button to specify that each parent entity is connected to one or more instances of the child entity.

•	Zero or One (Z). Click this button to specify that each parent entity is connected to zero or one instance of the child entity.

•	Exactly. Type the exact number of instances to connect the parent entity to the child entity.

•	Relationship Type. Specify the relationship type.

•	Identifying. Click this button to indicate that the relationship is an identifying relationship. No nulls are allowed in identifying relationships.

•	Non-Identifying. Click this button to indicate that the relationship is a non-identifying relationship.

Nulls. Specify whether the non-identifying relationship allows nulls.

•	Nulls Allowed. Click this button to indicate that the foreign key within the child entity will accept nulls. Available only for non-identifying relationships.

•	No Nulls. Click this button to indicate that the foreign key within the child entity will not accept nulls. Available only for non-identifying relationships.

•	Logical Only. Select this check box if you want the relationship to appear in the logical model only. Clear this check box if you want the relationship to appear in both the logical and physical model. Logical-only relationships do not appear in your data model when you switch to the physical model, but the parent entity’s primary key still migrates as a foreign key to the child entity.

Related Topics

  To create a two-part verb phrase using the Relationship Editor

  To create a two-part verb phrase using on-diagram editing

  To set relationship cardinality

  To change a relationship’s type

  To change the null option for a relationship

  Adding Verb Phrases to Relationships

  Setting Relationship Cardinality

  Setting Relationship Null Options

  Using the Relationship Editor in the Logical Model


To create a two-part verb phrase using the Relationship Editor

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select a relationship in the Relationship list.

3.	Click the General tab.

4.	Type the parent-to-child relationship in the Parent-to-Child text box and the child-to-parent relationship in the Child-to-Parent text box.

5.	Click OK.


To create a two-part verb phrase using on-diagram editing

1.	Click on the relationship line that you want to edit. ERwin displays a selection bar on the relationship line.

2.	Wait a moment, then click again. ERwin displays the on-diagram edit box for the parent-to-child verb phrase.

3.	Edit the verb phrase.

4.	Press the TAB key. ERwin displays the on-diagram edit box for the child-to-parent verb phrase.

5.	Edit the verb phrase.

6.	Press SHIFT+ENTER to save your changes.


To set relationship cardinality

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select a relationship in the Relationship list.

3.	Click the General tab.

4.	Select the cardinality option for the relationship in the Cardinality group box:

•	To specify that each parent in the relationship is connected to zero, one, or more instances of the child entity or table, select Zero, One or More.

•	To specify that each parent in the relationship is connected to one or more instances of the child entity or table, select One or More (P).

•	To specify that each parent in the relationship is connected to zero or one instance of the child entity or table, select Zero or One (Z).

•	To specify an exact number, select the Exactly option, then type the number of instances in the child entity or table for each instance of the parent entity or table.

5.	Click OK.


To change a relationship's type

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select a relationship in the Relationship list.

3.	Click the General tab.

4.	Select the appropriate type of relationship, either Identifying or Non-Identifying in the Relationship Type group box.

5.	Click OK.

Note:	You cannot change the relationship type for a recursive relationship. It must be non-identifying.


To change the null option for a relationship

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select a relationship in the Relationship list.

3.	Click the General tab.

4.	Select the null option that you want to assign to the relationship in the Nulls group box:

•	To create a mandatory relationship (no diamond on parent end), select the NO NULLS option.

•	To create a non-mandatory relationship (diamond on parent end), select the NULLS ALLOWED option.

5.	Click OK.


Entering a Relationship Definition

You use the controls in the Definition tab of the Relationship Editor to enter a definition for a relationship. The definition that you type should assist any person who reads the data model in understanding the purpose for the relationship. Follow your organization’s standards and conventions for defining the relationships in a data model.

The purpose of each control in the Definition tab is explained below:

•	Relationship Definition. Type or edit the relationship definition in this box.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  To enter a definition for a relationship

  Using the Relationship Editor in the Logical Model


To enter a definition for a relationship

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select a relationship in the Relationship list.

3.	Click the Definition tab.

4.	Type a definition for the relationship.

5.	Click OK.


Defining Attribute Rolenames and Referential Integrity Trigger Actions

You use the controls in the Rolename/RI Actions tab of the Relationship Editor to define attribute rolenames and referential integrity trigger actions for relationships.

The purpose of each control in the Rolename Info group box is explained below:

•	Migrated Attribute/Rolename. Displays the primary key attribute that is migrated from the parent entity to the child entity and the rolename associated with the attribute in the current relationship.

•	Rolename. Type or edit a rolename for the attribute you selected in the Migrated Attribute list.

The purpose of each control in the RI Actions group box is explained below:

•	Child Delete. Select the referential integrity trigger action that you want to occur when data in the child entity is deleted. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Child Insert. Select the referential integrity trigger action that you want to occur when data in the child entity is inserted. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Child Update. Select the referential integrity trigger action that you want to occur when data in the child entity is updated. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Parent Delete. Select the referential integrity trigger action that you want to occur when data in the parent entity is deleted. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Parent Insert. Select the referential integrity trigger action that you want to occur when data in the parent entity is inserted. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Parent Update. Select the referential integrity trigger action that you want to occur when data in the parent entity is updated. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

Related Topics

  To assign a rolename to an attribute

  To delete a rolename

 To define the referential integrity trigger actions for a relationship

  Defining Attribute Rolenames

  Defining Referential Integrity Actions

  Using the Relationship Editor in the Logical Model


To assign a rolename to an attribute

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select a relationship in the Relationship list.

3.	Click the Rolename/RI Actions tab.

4.	Select the attribute in the Migrated Attribute list to which you want to assign a rolename.

5.	Type or edit the rolename in the Rolename field.

6.	Click OK.

Note:	ERwin displays the rolename as the migrated key in your diagram. When you select the Rolename/Attribute Display Option, ERwin inserts a period after the rolename and before the basename.


To delete a rolename

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select a relationship in the Relationship list.

3.	Click the Rolename/RI Actions tab.

4.	Select the attribute in the Migrated Attribute list from which you want to delete the rolename.

5.	Remove the rolename from the Rolename field. DO NOT click the Delete button or you will delete the selected relationship.

6.	Click OK.


To define the referential integrity trigger actions for a relationship

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select a relationship in the Relationship list.

3.	Click the Rolename/RI Actions or RI Actions tab.

4.	Select a delete, insert, and update action for both the child and parent entity or table.

5.	Click OK.


Specifying Relationship UDP Values (Logical)

After you create UDPs for a relationship in the UDP Editor, you can easily specify property values for the relationship in the UDP tab of the Relationship Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP in which you can select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Relationship Editor in the Logical Model

  Using the Relationship Editor in the Physical Model

  To specify relationship UDP values

  Creating User-Defined Properties


To specify relationship UDP values (Logical)

1.	Define a relationship property. More>>

2.	Select Relationship from the Edit menu.

3.	Click on the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Adding Verb Phrases to Relationships

You use ERwin to add and edit verb phrases for the relationships in your diagram. Verb phrases describe the relationship that you create between a parent and child entity. You can use ERwin to create these two types of verb phrases for a relationship:

•	Parent-to-child verb phrase

•	Child-to-parent verb phrase

For example, in the MOVIES diagram, you might add the verb phrase <is in stock as> to describe the relationship between the parent entity MOVIE and the child entity MOVIE-COPY. You might also add the verb phrase <is a copy of> to describe the relationship between the child entity MOVIE-COPY and the parent entity MOVIE. If you enter both a parent-to-child and child-to-parent verb phrase, you have created a two-part verb phrase.

When you view the relationships that you create, ERwin displays a two-part verb phrase near the middle of the relationship line with the two phrases joined by a forward slash symbol (for example, is in stock as/is a copy of). You can split all of the two-part verb phrases in your diagram so that ERwin automatically places each part of the verb phrase near the entity to which it applies.

When you split a verb phrase for a single relationship, you can move each label separately. When you move a relationship line directly or move the entity to which it is connected, ERwin automatically moves the associated verb phrase. See Adjusting Relationship Lines for more information.

ERwin optionally displays the verb phrases for a relationship in the middle of the relationship line. If you want to see verb phrases in your diagram, set the Verb Phrase Display Option.

Related Topics

  To create a two-part verb phrase using the Relationship Editor

  To create a two-part verb phrase using on-diagram editing

  Verb Phrase Display Option


Setting Relationship Cardinality

You use ERwin to set the cardinality for the relationships in your diagram. Relationship cardinality represents the fact that each parent entity or table within a relationship is connected to a particular number of instances of the child entity or table. In IDEF1X, IE, and DM the cardinality of a relationship can be represented in one of these four ways:

•	Zero, one, or more - signified by a blank space. This means that each parent in the relationship is connected to zero, one, or more instances of the child entity or table.

•	One or more - signified by the letter P. This means that each parent in the relationship is connected to one or more instances of the child entity or table.

•	Zero or one - signified by the letter Z. This means that each parent in the relationship is connected to zero or more instance of the child entity or table.

•	Exactly. This means that each parent in the relationship is connected to an exact number of instances of the child entity or table. You specify the number of instances.

ERwin optionally displays the cardinality symbols for a relationship at the child end of a relationship line. If you do not see the cardinality symbols in your diagram, you must set the Cardinality Display Options.

When you create a non-identifying relationship you can choose whether a parent is required for each child by setting the null option for the relationship. See Setting Relationship Null Options for more information.

Related Topics

  To set relationship cardinality

  Cardinality Display Option (Logical)

  Cardinality Display Option (Physical)


Setting Relationship Null Options

When you create a non-identifying relationship, you must decide whether or not the foreign key attributes in the child entity or table that are inherited from the parent can have a NULLS ALLOWED or NO NULLS value. A NULLS ALLOWED value means that the child entity or table can exist without the existence of the parent and the relationship is optional. A NO NULLS value means that the child entity or table is dependent upon the parent entity or table for its existence and the relationship is mandatory.

Note:	Identifying relationships cannot be “null” because the foreign key appears as a part of the primary key in the child entity or table.

ERwin optionally displays NULL or NOT NULL values for each column in a table. If you want to see NULL or NOT NULL in your diagram, set the Null Display Option.

Related Topics

  To change the null option for a relationship

  Null Display Option


Defining Attribute Rolenames

When a primary key attribute migrates from a parent entity to a child entity, it becomes a foreign key attribute in the child entity. Since a foreign key can have a different role than the role of the related primary key, you can use ERwin to assign a rolename to a foreign key attribute. You assign a rolename to a foreign key to describe its role in a particular entity and to distinguish it from another attribute with the same name.

You assign the rolename to the foreign key attribute using the Relationship Editor in the logical model. ERwin displays the rolename as the foreign key.

ERwin optionally displays the basenames for the attributes in an entity. The basename is the attribute name that is migrated from the parent entity to the child entity. ERwin inserts a period after the rolename and then appends the attribute's basename. If you want to see basenames, select the Rolename/Attribute Display Option.

Related Topics

  To assign a rolename to an attribute

  To delete a rolename

  Rolename/Attribute Display Option


Defining Referential Integrity Trigger Actions

Business rules are logical constructs that express how a business uses its data. You can use ERwin to use a set of built-in referential integrity actions to capture common business rules that apply to the relationships between data in different entities or tables. You can enforce these rules using referential integrity trigger actions. These actions tell the database management system what action to take when you attempt to delete, insert, or update a row in an entity or table.

The four types of referential integrity trigger actions that you can define for the relationships in your diagram include:

•	RESTRICT. Prevents you from deleting, inserting, or updating an instance in the parent or child entity or table if there are one or more related instances in the child or parent entity or table.

•	CASCADE. When an instance in the parent entity or table is deleted, inserted, or updated, each related instance in the child entity or table is also deleted, inserted, or updated.

•	SET NULL. When an instance in the parent entity or table is deleted, inserted, or updated, the foreign key attributes or columns in each related instance of the child entity or table are set to NULL.

•	SET DEFAULT. When an instance in the parent entity or table is deleted, inserted, or updated, the foreign key attributes or columns in each related instance of the child entity or table are set to the specified default value.

•	NONE. No referential integrity action is required.

ERwin automatically assigns a default referential integrity trigger action to each relationship when you add it to a diagram based on the default you specified in the Target Server dialog. See Selecting the Target Server for more information.

ERwin optionally displays the referential integrity symbols for a relationship at both the child and parent end of a relationship line. If you do not see the referential integrity symbols in your diagram, you must set the Referential Integrity Display Options.

Related Topics

 To define the referential integrity trigger actions for a relationship

  Referential Integrity Display Option (Logical)

  Referential Integrity Display Option (Physical)


Navigating a Model Using Relationships

ERwin provides a number of options that let you quickly navigate between entities or tables in a large model. One way to navigate a model is to use the Go To Parent or Go To Child options on the relationship shortcut menu to proceed to either the parent or child entity or table for the selected relationship. ERwin automatically displays the portion of the diagram that contains the parent or child entity or table for the current relationship.

Related Topics

  To navigate a model using relationships


To navigate a model using relationships

•	Right-click on a relationship, then choose Go To Parent on the shortcut menu to display the portion of the diagram containing the parent entity or table for the current relationship.

•	Right-click on a relationship, then choose Go To Child on the shortcut menu to display the portion of the diagram containing the child entity or table for the current relationship.


Unifying Relationships

When you create a relationship, a dependent entity or table may inherit a foreign key from more than one parent entity or table with the same name. When ERwin encounters this situation, it assumes that the two entities or tables are the same and that you only want to see the attribute or column once in the dependent entity or table. ERwin shows one occurrence of the attribute or column in the Attribute or Column Editor and one occurrence in the diagram. This combining, or unifying, of identical attributes in an entity is called unification.

Unification is the merging of two or more foreign key attributes or columns into a single foreign key attribute or column based on the assumption that the values of the original foreign key attributes or columns must be identical. Unification occurs because normalization rules prohibit the existence of two attributes or columns that have the same name in a single entity or table.

There are other occasions when unification is not the desired result. This might happen when two attributes have the same name, but you want to preserve them differently in your diagram. In this example, you use rolenames to preserve the difference between the two attributes. See Defining Attribute Rolenames for more information.

Related Topics

  Foreign Key Migration


Foreign Key Migration

Foreign key attributes or columns automatically migrate from a parent to child entity or table when you connect them using a relationship. You can see the migrated attributes or columns in the child entity or table when you set the Stored Display logical options to display the Foreign Key Designator and Migrated Attributes. You can also set these options from Display Options/Entities or Display Options/Tables on the diagram shortcut menu.

•	In an identifying relationship, the primary key attributes of the parent entity become primary key attributes of the child, which means the child entity is dependent on the parent entity for its identify, and cannot exist without it.

•	In a non-identifying relationship, the primary key attributes of the parent entity become non-key attributes of the child, which means the child entity is not dependent on the parent entity for its identify, and can exist without it.

If two foreign keys have the same name, they unify when they migrate. See Unifying Relationships for more information.

Note:	When you delete a relationship, the automatic migration is reversed, and the migrated foreign keys are automatically removed from the child entity or table.

Related Topics

  Migrating Column Properties

  Attribute Display Level

  Foreign Key Designator Display Option (Logical)

  Foreign Key Designator Display Option (Physical)

  Primary Key Display Level (Logical)

  Primary Key Display Level (Physical)

  Show Migrated Attributes Display Option


Deleting a Relationship

You can use the Relationship Editor to delete a relationship in your model. When you create a relationship, foreign key attributes automatically migrate across relationships. Therefore, when you delete a relationship, the contributed foreign key attributes, foreign key columns, or view columns are automatically removed from the child entity, table, or view.

Hint:	You can also delete the relationship line by selecting the line and then pressing the DELETE key. ERwin prompts you to confirm the delete.

Related Topics

  To delete a relationship

  Foreign Key Migration


To delete a relationship

1.	Right-click on a relationship, then choose Relationship Editor on the shortcut menu.

2.	Select the relationship that you want to delete in the Relationship list.

3.	Click Delete.

4.	Click OK.

Hint:	You can also delete the relationship line by selecting the line and then pressing the DELETE key. ERwin still prompts you to confirm the delete.

Note:	When you delete a relationship, the contributed foreign key attributes, foreign key columns, or view columns are automatically removed from the child entity, table, or view.


Working with Relationships in the Physical Model

A relationship is used in an ERwin physical data model to show that there is an association or link between two tables, or between a table and itself. You can use ERwin's physical modeling features to create these three types of relationships:

•	Identifying relationship

•	Non-identifying relationship

•	Recursive relationship

Each relationship can visually depict seven pieces of information:

•	Type of relationship

•	Parent end of relationship

•	Child end of relationship

•	Optional symbol (only for non-identifying relationships)

•	Referential integrity

•	Foreign key name

•	Cardinality

Relationships are used in both the logical and physical models, and can be represented in either model as one or more foreign key attributes. See Working With Relationships in the Logical Model for more information.

When you create a relationship, ERwin labels the relationship R_n, where R stands for relationship, and n is a unique number. ERwin assigns each number only once per model and calculates new relationship numbers beginning with the number zero.

Related Topics

  Creating a Relationship in the Physical Model

  Using the Relationship Tools in the Physical Model

  Using the Relationship Editor in the Physical Model

  Navigating a Model Using Relationships

  Unifying Relationships

  Foreign Key Migration

  Partial Key Migration

  Deleting a Relationship


Creating a Relationship in the Physical Model

Identifying, non-identifying, and recursive relationships can be created in ERwin through:

•	Using the Relationship Tools

•	Reverse engineering and existing database. See Reverse Engineering from a DDL Script or Database for more information.


Using the Relationship Tools in the Physical Model

ERwin includes three tools in the ERwin toolbox for creating identifying, non-identifying, and recursive relationships, as shown below.

Related Topics

  Creating an Identifying Relationship

  Creating a Non-Identifying Relationship

  Creating a Recursive Relationship

  Creating a View Relationship


Creating an Identifying Relationship in the Physical Model

An identifying relationship is a relationship between two tables in which an instance of a child table is identified through its association with a parent table, which means the child table is dependent on the parent table for its identity, and cannot exist without it. In an identifying relationship, one instance of the parent table is related to multiple instances of the child.

ERwin draws, in IDEF1X notation, an identifying relationship line as a solid line with a diamond or a filled circle at either end of the line. ERwin draws, in IE notation, an identifying relationship line as a solid line with crow's feet.

Note:	ERwin automatically migrates primary keys from a parent table to a child table, so you do not need to enter any foreign keys in the child.

Related Topics

  To create an identifying relationship in the physical model

  Navigating a Model Using Relationships

  Unifying Relationships

  Foreign Key Migration

  Relationship and Cardinality Symbols


To create an identifying relationship in the physical model

1.	Click [image] in the ERwin toolbox. The cursor changes to [image].

2.	Click on the parent table, then click on the child table.

Note:	ERwin automatically migrates primary keys from a parent table to a child table, so you do not need to enter any foreign keys in the child.


Creating a Non-Identifying Relationship in the Physical Model

A non-identifying relationship is a relationship between two tables in which an instance of the child table is not identified through its association with a parent table, which means the child table is not dependent on the parent table for its identify, and can exist without it. In a non-identifying relationship, one instance of the parent table is related to multiple instances of the child.

You can use ERwin to create these two types of non-identifying relationships:

•	Optional non-identifying relationship

•	Mandatory non-identifying relationship

You can also use non-identifying relationships to create recursive relationships.

Note:	ERwin automatically migrates primary keys from a parent table to a child table, so you do not need to enter any foreign keys in the child.

Related Topics

  To create a non-identifying relationship in the physical model

  Creating a Recursive Relationship

  Navigating a Model Using Relationships

  Unifying Relationships

  Foreign Key Migration

  Relationship and Cardinality Symbols


Optional Non-Identifying Relationship (Physical)

In an optional non-identifying relationship, the columns that are migrated into the non-key area of the child table are not required in the child table. This means that nulls are allowed in the foreign key. ERwin draws an optional non-identifying relationship differently depending on the notation for your diagram:

•	IDEF1X notation draws a dashed line with a solid dot on the child end and a diamond on the parent end.

•	IE notation draws a dashed line with a cross and a circle on the parent end. The child end indicates the cardinality with:

•	crows feet with a cross and a circle, as shown below (Zero, one or more)

•	crows feet with a cross (One or more)

•	a cross and a circle (Zero or one)

•	a dashed line (Exactly n)

IDEF1X Notation	IE Notation

Related Topics

  Relationship and Cardinality Symbols

  Optional Non-identifying Relationship (Logical)


Mandatory Non-Identifying Relationship (Physical)

In a mandatory non-identifying relationship, the columns that are migrated into the non-key area of the child table are required in the child table. This means that the foreign key cannot be null. ERwin draws a mandatory non-identifying relationship differently depending on the notation for your diagram:

•	IDEF1X notation draws a dashed line with a solid dot on the child end.

•	IE notation draws a dashed line with a cross on the parent end. The child end indicates the cardinality with:

•	crows feet with a cross and a circle, as shown below (Zero, one or more)

•	crows feet with a cross (One or more)

•	a cross and a circle (Zero or one)

•	a dashed line (Exactly n)

•	DM notation draws a dashed line.

IDEF1X Notation	IE Notation	DM Notation

Related Topics

  Relationship and Cardinality Symbols

  Mandatory Non-Identifying Relationship (Logical)


To create a non-identifying relationship in the physical model

1.	Click [image] in the ERwin toolbox. The cursor changes to [image].

2.	Click on the parent table, then click on the child table.

Note:	ERwin automatically migrates primary keys from a parent table to a child table, so you do not need to enter any foreign keys in the child.


Using the Relationship Editor in the Physical Model

Using the Relationship Editor in the physical model, you can specify the properties of a relationship such as its foreign key name, cardinality, type, and null options. You can also use the Relationship Editor to type a foreign key comment and define referential integrity trigger actions. Right-click on a relationship, then choose Relationship Editor on the shortcut menu to open the Relationship Editor.

The purpose of each control in the Relationship Editor is explained below:

•	Relationship. Displays the currently selected relationship. To view the properties of another relationship, select a different relationship from the list.

•	New. Opens the New Relationship dialog in which you can add a new relationship.

•	Delete. Deletes the selected relationship.

•	Physical Only. Displays the relationship in the physical model only.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The Relationship Editor includes the following tabs:

•	General. Add or edit general information about a relationship.

•	Comment. Add or edit a foreign key comment for a relationship.

•	RI Actions. Define referential integrity actions.

•	UDP. Specify a user-defined property value for the selected relationship.

Related Topics

  To display a relationship in the physical model only


To display a relationship in the physical model only

1.	Right-click on a relationship, then choose Relationship Editor on the submenu.

2.	Choose the relationship that you want to appear only in the physical model in the Relationship list.

3.	Select the Physical Only check box.

4.	Click OK.


Specifying General Properties for a Relationship in the Physical Model

You use the controls in the General tab of the Relationship Editor to add and edit the general information about a relationship, including foreign key constraint name, relationship cardinality, relationship type, and null options.

The purpose of each control in the General tab is explained below:

•	Foreign Key Constraint Name. Type or edit the foreign key constraint name for the parent-to-child and child-to-parent relationship.

•	Cardinality. Specify the cardinality for the selected relationship.

•	Zero, One or More. Click this button to specify that each parent table is connected to zero, one, or more instances of the child table.

•	One or More (P). Click this button to specify that each parent table is connected to one or more instances of the child table.

•	Zero or One (Z). Click this button to specify that each parent table is connected to zero or one instance of the child table.

•	Exactly. Type the exact number of instances to connect the parent table to the child table.

•	Type. Specify the relationship type.

•	Identifying. Click this button to indicate that the relationship is an identifying relationship. No nulls are allowed in identifying relationships.

•	Non-Identifying. Click this button to indicate that the relationship is a non-identifying relationship.

•	Nulls. Specify whether the non-identifying relationship allows nulls.

•	Nulls Allowed. Click this button to indicate that the foreign key within the child table will accept nulls. Available only for non-identifying relationships.

•	No Nulls. Click this button to indicate that the foreign key within the child table will not accept nulls. Available only for non-identifying relationships.

•	Physical Only. Select this check box if you want the relationship to appear in the physical model only. Clear this check box if you want the relationship to appear in both the physical and logical model. Physical-only relationships do not appear in your data model when you switch to the logical model, but the parent table’s primary key still migrates as a foreign key to the child table.

Related Topics

  To create a foreign key name using the Relationship Editor

  To create a foreign key name using diagram editing

  To set relationship cardinality

  To change a relationship’s type

  To change the null option for a relationship

  Adding the Foreign Key Name to Relationships

  Setting Relationship Cardinality

  Setting Relationship Null Options

  Using the Relationship Editor in the Physical Model


To create a foreign key name using the Relationship Editor

1.	Right-click on a relationship, then choose Relationship Editor on the submenu.

2.	Select a relationship in the Relationship list.

3.	Click the General tab.

4.	Type the foreign key name in the Foreign Key Name field.

5.	Click OK.


To create a foreign key name using on-diagram editing

1.	Click on the relationship line that you want to edit. ERwin displays a selection bar on the relationship line.

2.	Wait a moement, then click again. ERwin displays the diagram edit box.

3.	Type the foreign key name.

4.	Press SHIFT+ENTER to save your changes.


Entering a Relationship Foreign Key Comment

You use the controls in the Comment tab of the Relationship Editor to type a foreign key comment for a relationship. The comment that you enter should help any person who reads the data model to understand the purpose for the foreign key.

The purpose of each control in the Comment tab is explained below:

•	Foreign Key Comment. Type or edit the foreign key comment.

•	Update Relationship Definition to Match. Select this check box to update the corresponding relationship definition to match the foreign key comment.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  To enter a foreign key comment for a relationship

  Using the Relationship Editor in the Physical Model


To enter a foreign key comment for a relationship

1.	Right-click on a relationship, then choose Relationship Editor on the submenu.

2.	Select a relationship in the Relationship list.

3.	Click the Comment tab.

4.	Type a foreign key comment for the relationship.

5.	Click OK.


Specifying Relationship UDP Values (Physical)

After you create UDPs for a relationship in the UDP Editor, you can easily specify property values for the relationship in the UDP tab of the Relationship Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP in which you can select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Relationship Editor in the Physical Model

  Using the Relationship Editor in the Logical Model

  To specify relationship UDP values

  Creating User-Defined Properties


To specify relationship UDP values

1.	Define a relationship property. More>>

2.	Select Relationship from the Edit menu.

3.	Click on the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Defining Referential Integrity Trigger Actions

You use the controls in the RI Actions tab of the Relationship Editor to define referential integrity trigger actions for physical relationships.

The purpose of each control in the RI Actions group box is explained below:

•	Child Delete. Select the referential integrity trigger action that you want to occur when data in the child table is deleted. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Child Insert. Select the referential integrity trigger action that you want to occur when data in the child table is inserted. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Child Update. Select the referential integrity trigger action that you want to occur when data in the child table is updated. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Parent Delete. Select the referential integrity trigger action that you want to occur when data in the parent table is deleted. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Parent Insert. Select the referential integrity trigger action that you want to occur when data in the parent table is inserted. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Parent Update. Select the referential integrity trigger action that you want to occur when data in the parent table is updated. Available actions include RESTRICT, CASCADE, SET NULL, SET DEFAULT, or NONE.

•	Parent Table Name. Select the synonym name for the parent table. Available only for Red Brick.

Related Topics

 To define the referential integrity trigger actions for a relationship

  Defining Referential Integrity Actions

  Using the Relationship Editor in the Physical Model


Adding the Foreign Key Name to Relationships

You use ERwin to add and edit the foreign key name for the physical relationships in your diagram. The foreign key name describes the relationship that you create between a parent and child table. For example, in the MOVIES diagram, you might add the foreign key name <is_in_stock_as> to describe the relationship between the parent table MOVIE and the child table MOVIE-COPY.

When you view the relationships that you create, ERwin displays the foreign key name near the middle of the relationship line. You can move each foreign key name separately. When you move a relationship line directly or move the table to which it is connected, ERwin automatically moves the associated foreign key name. See Adjusting Relationship Lines for more information.

ERwin optionally displays the foreign key constraint name for a relationship in the middle of a relationship line. If you want to see foreign key names in your diagram, set the Foreign Key Constraint Name Display Option.

Related Topics

  To create a foreign key name using the Relationship Editor

  To create a foreign key name using on-diagram editing

  Foreign Key Constraint Name Display Option


Partial Key Migration

ERwin supports partial key migration in the physical model. The partial key migration feature is implemented by hiding one or more columns that were migrated to a table as foreign key columns. As a result, when you generate your model, each table can include all migrated foreign key columns or any subset of them as you have indicated in the model.

To hide a portion of a migrated foreign key, select the table that contains the column(s) you want to hide, then switch to the logical model. Right-click on the selected table, then choose Attribute Editor on the shortcut menu. In the Attribute Editor, you can select each attribute that corresponds to a column you want to hide and select the Logical Only check box.

When you return to the physical model, the selected foreign key columns no longer appear in the selected table.

To reverse partial key migration, return to the logical model and clear the Logical Only check box for the corresponding attribute.

Related Topics

  To migrate a partial key in the physical model


To migrate a partial key in the physical model

1.	Select the table that contains the foreign key columns you want to hide.

2.	Select Logical Model in the Logical/Physical model option in the ERwin Toolbar to switch to the logical model. ERwin automatically displays the entity that corresponds to the selected table in the logical model window.

3.	Right-click on the entity in the logical model that corresponds to the selected table in the physical model, then choose Attribute Editor on the shortcut menu.

4.	Click the General tab.

5.	Select an attribute that corresponds to a column you want to hide in the Attribute list box.

6.	Select the Logical Only check box.

7.	Repeat Steps 5 and 6 for each attribute or column that you want to hide in the physical model.

8.	Click OK.

9.	Select Physical Model in the Logical/Physical model option in the ERwin Toolbar to return to the physical model.


Working With Scripts

Pre and post scripts are SQL scripts that you want ERwin to include before or after other statements in the schema generation script. ERwin supports pre and post scripts for:

•	Schema Generation. You can create a script that is included at the beginning or end of the schema generation script.

•	Tables. You can create a script that is included before or after the CREATE TABLE statement in the schema generation script.

•	Views. You can create a script that is included before or after the CREATE VIEW statement in the schema generation script.

You can create scripts in ERwin using templates, which can contain both SQL code and ERwin macros. You use ERwin macros to assist you in adding the names and properties of ERwin objects in the script template code. ERwin automatically expands any macros based on the current state of your ERwin model when it generates the script template.

ERwin provides several editors for working with script templates:

•	Table Script Template Editor. Lets you create pre and post script templates that you attach to tables or views.

•	Script Browser. Lets you view and manage individual script templates, and the tables or views that are attached to them.

•	Schema Properties Editor. Lets you attach pre and post scripts to the schema.

•	Schema Script Template Editor. Lets you create pre and post script templates that you attach to the schema.

•	Pre & Post Script Tab of the Table or View Editor. Lets you assign script templates to tables or views in your model.

Related Topics

  Schema Pre Script Template Example

  DBMS Support for Triggers, Scripts, and Stored Procedures


Schema Pre Script Template Example

The following example shows how you might use ERwin macros in a schema pre script to drop existing tables before the schema is generated on a SYBASE target server.

%ForEachTable() {
if exists (select * from sysobjects
 where id = object_id(‘dbo.%tablename’) and sysstat & 0xf = 3)
 drop table dbo.%tablename

GO

}

ERwin generates the expanded code and executes it with the GO statement during schema generation.

if exists (select * from sysobjects
 where id = object_id(‘dbo.MOVIE_RENTAL_RECORD’) and sysstat & 0xf = 3)
 drop table dbo.MOVIE_RENTAL_RECORD

GO

if exists (select * from sysobjects
 where id = object_id(‘dbo.MOVIE’) and sysstat & 0xf = 3)
 drop table dbo.MOVIE

GO

if exists (select * from sysobjects
 where id = object_id(‘dbo.MOVIE_COPY’) and sysstat & 0xf = 3)
 drop table dbo.MOVIE_COPY

GO

if exists (select * from sysobjects
 where id = object_id(‘dbo.CUSTOMER’) and sysstat & 0xf = 3)
 drop table dbo.CUSTOMER

GO


Using the Table Script Template Editor

Using the Table Script Template Editor, you can create new script templates, and view or modify the code that is used by a particular script template. You can attach the script templates that you create to tables or views in your model.

There are two ways that you can access the Table Script Template Editor:

•	Right-click on a table, point to Table Editor on the shortcut menu, choose Pre & Post Script on the cascade menu, then click the Script Template button.

•	Right-click on a view, click View Editor on the shortcut menu, click the Pre & Post Script tab, then click the Script Template button.

The purpose of each control in the Table Script Template Editor is explained below:

•	Script Template Name. Lists the name of each script template in the active model.

•	Type. Displays the script template type, either Pre (include script before the CREATE TABLE statement) or Post (include script after the CREATE TABLE statement).

•	Code. Displays the first line of the script template, which can include SQL statements and ERwin macros.

•	Attach to New Table. Select this check box to automatically attach the script template to each new table that you create. Clear this check box if you want to manually attach the script template to new tables.

•	Pre-Table Creation. Click this button if you want the script to appear before the CREATE TABLE statement in the schema generation script.

•	Post-Table Creation. Click this button if you want the script to appear after the CREATE TABLE statement in the schema generation script.

•	Table Script Template. Displays the template code for the selected script template, which can include SQL statements and ERwin macros.

•	New. Click this button to open the New Script Template dialog and add a new script template.

•	Rename. Click this button to open the Rename Script Template dialog and edit the name of the selected script template.

•	Delete. Deletes the selected script template.

•	Toolbox. Click this button to open the ERwin Template Toolbox and select an ERwin macro to add to the script template. See Using the Template Toolbox and Macros for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  Using the Table Editor

  To create a script template for a table or view

  To view the script template for a table or view

  To modify a script template for a table or view

  To delete a script template for a table or view


To create a script template for a table or view

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Pre & Post Script on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Pre & Post Script.

2.	Click the Script Template button.

3.	Click the New button.

4.	Enter a descriptive name for the script template.

5.	Click OK.

6.	Choose the Pre & Post Script tab.

7.	Click in the Table Script Template window and enter the template code for the new script. You can use the macros in the ERwin Template Toolbox in the script template. More>

8.	Click OK to close the Table Script Template Editor.

9.	Click OK.

Note:	Click the Attach to New Table check box before you close the editor to automatically attach the script template to each new table that you create.


To view the script template for a table or view

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Pre & Post Script on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Pre & Post Script.

2.	Click the Script Template button.

3.	Select the script template you want to view in the Script Template Name list box.

4.	To view additional lines of code, use the scroll bars to scroll the code in the Table Script Template window.

5.	Click OK to close the Table Script Template Editor.

6.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To modify a script template for a table or view

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Pre & Post Script on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Pre & Post Script.

2.	Click the Script Template button.

3.	Select the script template you want to edit in the Script Template Name list box.

4.	Choose one or more of the following options:

•	To rename a script template, click Rename, then enter a new name for the script template.

•	To modify a script template, edit the text in the Table Script Template window.

•	To change the template type, click the Pre-Table Creation or Post-Table Creation button.

5.	Click OK to close the Table Script Template Editor.

6.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To delete a script template for a table or view

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Pre & Post Script on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Pre & Post Script.

2.	Click the Script Template button.

3.	Select the script template you want to delete in the Script Template Name list box.

4.	Click Delete.

5.	Click OK to close the Table Script Template Editor.

6.	Click OK.


Using the Script Browser

Using the Script Browser, you can see the tables and views that are attached to a script template and view the code that is used by a particular script template. You can also attach tables and views in your model to existing script templates.

There are two ways that you can access the Script Browser:

•	Right-click on a table, point to Table Editor on the shortcut menu, choose Pre & Post Script on the cascade menu, then click the Script Browser button.

•	Right-click on a view, click View Editor on the shortcut menu, click the Pre & Post Script tab, then click the Script Browser button.

The purpose of each control in the Script Browser is explained below:

•	Script Template Name. Lists the name of each script template in the active model. Select a script template from the list to view the attached tables in the Attached Table list box, or view the template code in the Script Template window.

•	Type. Displays the script template type, either Pre (execute script before schema generation) or Post (execute script after schema generation).

•	Code. Displays the first line of the script template, which can include SQL statements and ERwin macros.

•	Script Template . Click this button to open the Table Script Template Editor. See Using the Table Script Template Editor for more information.

•	Attached Table. Lists the tables and views that are attached to the selected script template. Select a table or view from the list and click Detach to remove it from the script template.

•	<-Attach. Attaches the selected table or view to the selected script template. This button is unavailable if you have not selected a table or view in the Unattached Table list box.

•	<<-Attach All. Attaches all tables and views in the Unattached Table list box to the selected script template.

•	Detach->. Detaches the selected table or view in the Attached Table list box from the selected script template. This button is unavailable if you have not selected a table or view in the Attached Table list box.

•	Detach All->>. Detaches all tables and views in the Attached Table list box from the selected script template.

•	Unattached Table. Lists all tables and views in the active model that are not attached to the selected script template. Select a table or view from the list and click Attach to attach it to the selected script template.

•	Script Template [Read Only]. Displays the template code for the selected script template. To modify the script template, open the Table Script Template Editor. See Using the Table Script Template Editor for more information.

•	Script Expansion [Read Only]. Displays the expanded code for the selected script template. Expanded code is the code that will appear in the schema script when the schema is generated.

•	Close. Closes the browser and saves any changes.

Related Topics

  To view the tables and views attached to a script template

  To attach a table or view to a script template

  To detach a table or view from a script template


To view the tables and views attached to a script template

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Pre & Post Script on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Pre & Post Script.

2.	Click the Script Browser button.

3.	Select the script template you want to view in the Script Template Name list box. ERwin displays all tables and views that are attached to the script template in the Attached Table list box, and the template code and expanded code for the selected script in the Script Template and Script Expansion windows.

4.	Click Close to close the Script Browser.

5.	Click OK.


To attach a table or view to a script template

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Pre & Post Script on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Pre & Post Script.

2.	Click the Script Browser button.

3.	Click the name of a script template in the Script Template Name list box.

4.	Select the name of the table or view you want to attach in the Unattached Table list box.

5.	Click Attach.

6.	Click Close to close the Script Browser.

7.	Click OK.

Hint:	Select Attach All to attach all tables and views in the Unattached Table list box to the selected script template.


To detach a table or view from a script template

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Pre & Post Script on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Pre & Post Script.

2.	Click the Script Browser button.

3.	Click the name of a script template in the Script Template Name list box.

4.	Select the name of the table or view you want to detach in the Attached Table list box.

5.	Click Detach.

6.	Click Close to close the Script Browser.

7.	Click OK.

Hint:	Select Detach All to detach all tables and views in the Attached Table list box from the selected script template.


Using the Schema Properties Editor

Using the Schema Properties Editor, you can attach script and stored procedure templates to the schema, and view the code for each template.

Choose <Database> Schema Property on the Server menu to open the Schema Properties Editor.

The purpose of each control in the Schema Properties Editor is explained below.

•	DB Sync. Click this button to start the Complete Compare task and synchronize the scripts defined in your data model with the information stored on the server. See Using the DB Sync Button for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The Schema Properties Editor includes the following tabs:

•	Stored Procedure. Attach stored procedures to the schema.

•	Pre & Post Script. Attach pre and post scripts to the schema.

Related Topics

  Pre Script Template Example


Attaching a Pre or Post Script to the Schema

Using the controls in the Pre & Post Script tab of the Schema Properties Editor, you can attach a pre or post script to the schema, and view the code contained in each script template.

Choose <Database> Schema Property on the Server menu to open the Schema Properties Editor, then choose the Pre & Post Script tab.

The purpose of each control in the Pre & Post Script tab is explained below.

•	Attached Script. Lists all script templates in the active model that are attached to the schema. ERwin generates the attached script templates when it generates the schema. Select a script template from the list to view the template code, or click Detach to move the script to the Unattached Script list box.

•	Type. Lists whether the script is Pre, which executes before the schema is generated, or Post, which executes after the schema is generated.

•	<-Attach. Attaches the selected script template to the schema. This button is unavailable if you have not selected a script template in the Unattached Script list box.

•	Detach->. Detaches the selected script template from the schema. This button is unavailable if you have not selected a script template in the Attached Script list box.

•	Unattached Script. Lists all script templates in the active model that are not attached to the schema. Unattached scripts do not appear in the schema script when ERwin generates the schema. Select a script template from the list to view the template code, or click Attach to attach it to the schema.

•	Type. Lists whether the script is Pre, which executes before the schema is generated, or Post, which executes after the schema is generated.

•	Script Template. Displays the template code for the selected script template, which can include SQL statements and ERwin macros.

•	Script Expansion [Read Only]. Displays the expanded code for the selected script template. Expanded code is the code that will appear in the schema script when the schema is generated.

•	Schema Script Template. Click this button to open the Schema Script Template Editor. See Using the Schema Script Template Editor for more information.

Related Topics

  Using the Schema Properties Editor

  To attach a script to the schema

  To detach a script from the schema

  Pre Script Template Example


To attach a script to the schema

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Pre & Post Script tab.

3.	Select the name of the script template you want to attach to the schema in the Unattached Script list box.

4.	Click Attach.

5.	Click OK.


To detach a script from the schema

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Pre & Post Script tab.

3.	Select the name of the script template you want to detach from the schema in the Attached Script list box.

4.	Click Detach.

5.	Click OK.


Using the Schema Script Template Editor

Using the Schema Script Template Editor, you can create new script templates, and view or modify the code that is used by a particular script template.

Choose <Database> Schema Property on the Server menu to display the Schema Properties Editor. Choose the Pre & Post Script tab, then click the Schema Script Template button to display the Schema Script Template Editor.

The purpose of each control in the Schema Script Template Editor is explained below:

•	Script Template Name. Lists all of the script templates in the active model.

•	Type. Displays the script template type, either Pre (execute script before schema generation) or Post (execute script after schema generation).

•	Code. Displays the first line of the script template, which can include SQL statements and ERwin macros.

•	Pre-Schema Creation. Click this button to specify that ERwin includes the expanded code for the script before all other statements in the schema script.

•	Post-Schema Creation. Click this button to specify that ERwin includes the expanded code for the script after all other statements in the schema script.

•	Schema Script Template. Displays the template code for the selected script template.

•	New. Click this button to open the New Script Template dialog and add a new script template.

•	Rename. Click this button to open the Rename Script Template dialog and edit the name of the selected script template.

•	Delete. Deletes the selected script template.

•	Toolbox. Click this button to open the ERwin Template Toolbox and select an ERwin macro to add to the script template. See Using the Template Toolbox and Macros for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To create a schema script template

  To view the schema script template code

  To modify a schema script template

  To delete a schema script template

  Pre Script Template Example


To create a schema script template

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Pre & Post Script tab.

3.	Click the Schema Script Template button.

4.	Click the New button.

5.	Enter a descriptive name for the script template.

6.	Click OK.

7.	Click in the Schema Script Template window and enter the template code.

8.	Click OK to close the Schema Script Template Editor.

9.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To view the schema script template code

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Pre & Post Script tab.

3.	Click the Schema Script Template button.

4.	Select the schema template you want to view in the Script Template Name list box.

5.	To view additional lines of code, use the scroll bars to scroll the code in the Schema Script Template window.

6.	Click OK to close the Schema Script Template Editor.

7.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To modify a schema script template

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Pre & Post Script tab.

3.	Click the Schema Script Template button.

4.	Select the script template you want to edit in the Script Template Name list box.

5.	Choose one or more of the following options:

•	To rename a script template, click Rename, then enter a new name for the script template.

•	To modify a script template, edit the text in the Schema Script Template window.

•	To change the template type, click the Pre-Schema Creation or Post-Schema Creation button.

6.	Click OK to close the Schema Script Template Editor.

7.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To delete a schema script template

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Pre & Post Script tab.

3.	Click the Schema Script Template button.

4.	Select the script template you want to delete in the Script Template Name list box.

5.	Click Delete.

6.	Click OK to close the Schema Script Template Editor.

7.	Click OK.


Attaching a Script to a Table or View

You use the Pre & Post Script tab of the Table Editor or View Editor to assign script templates to tables or views in your model.

The purpose of each control in the Pre & Post Script tab is explained below:

•	Attached Script. Lists the script templates in the active model that are attached to the selected table or view. Select a script template from the list to view the template code, or click Detach to remove a script from the selected table or view.

•	Type. Lists whether the script is Pre, which executes before the CREATE TABLE or CREATE VIEW statement, or Post, which executes after the CREATE TABLE or CREATE VIEW statement.

•	<-Attach. Attaches the selected script template to the selected table or view. This button is unavailable if you have not selected a script template in the Unattached Script list box.

•	Detach->. Detaches the selected script template from the selected table or view. This button is unavailable if you have not selected a script template in the Attached Script list box.

•	Unattached Script. Lists all script templates in the active model that are not attached to the selected table or view. Select a script template from the list to view the template code, or click Attach to attach a script to the selected table or view.

•	Type. Lists whether the script is Pre, which executes before the CREATE TABLE or CREATE VIEW statement, or Post, which executes after the CREATE TABLE or CREATE VIEW statement.

•	Script Template. Displays the template code for the selected script template, which can include SQL statements and ERwin macros.

•	Script Expansion [Read Only]. Displays the expanded code for the selected script template. Expanded code is the code that will appear in the schema script when the schema is generated.

•	Script Browser. Click this button to open the Script Browser. See Using the Script Browser for more information.

•	Script Template. Click this button to open the Table Script Template Editor. See Using the Table Script Template Editor for more information.

Related Topics

  Using the Table Editor

  Using the View Editor

  To attach a script to a table or view

  To detach a script from a table or view

  To change the order of script execution


To attach a script to a table or view

1.	Choose one of the following options:

•	To attach a script to a table, right-click on the table, then click Table Editor on the shortcut menu.

•	To attach a script to a view, right-click on the view, then click View Editor on the shortcut menu.

2.	Click the Pre & Post Script tab.

3.	Click the name of the script template that you want to attach to the table or view in the Unattached Script list box.

4.	Click Attach.

5.	Click OK.


To detach a script from a table or view

1.	Choose one of the following options:

•	To attach a script to a table, right-click on the table, then click Table Editor on the shortcut menu.

•	To attach a script to a view, right-click on the view, then click View Editor on the shortcut menu.

2.	Click the Pre & Post Script tab.

3.	Click the name of the script template that you want to remove from the table or view in the Attached Script list box.

4.	Click Detach.

5.	Click OK.


To change the order of script execution

1.	Choose one of the following options:

•	To change the order of script execution for a table, right-click on the table, then click Table Editor on the shortcut menu.

•	To change the order of script execution for a view, right-click on the view, then click View Editor on the shortcut menu.

2.	Click the Pre & Post Script tab.

3.	Click the name of a script template in the Attached Script list box and drag the script template up or down in the list to change the position in the list of scripts for the selected table or view.

4.	Click OK.

Note:	The cursor changes to [image] while you are moving the script.


DBMS Support for Triggers, Scripts, and Stored Procedures

The table below lists the support offered by SQL and desktop DBMS target servers for triggers, stored procedures, and pre and post scripts.

	RI Triggers	Stored Procedures	Pre/Post Scripts
AS/400 2			♦
AS/400 3	♦		♦
DB2/MVS 2, 3, 4			♦
DB2/2 2	♦		♦
INFORMIX 5.1, 6.0, 7.x	♦	♦	♦
Ingres 6.4, OpenIngres 1.1	♦	♦	♦
InterBase	♦	♦	♦
MS SQL Server 4.x, 6.x	♦	♦	♦
ORACLE 6			♦
ORACLE 7.x	♦	♦	♦
PROGRESS 7.x, 8.x	♦	♦	♦
Rdb 4, 6	♦		♦
Red Brick 3.0, 4.0, 5.0			♦
SQL Anywhere 5.0	♦	♦	♦
SQLBase 5.0			♦
SQLBase 6.0	♦	♦	♦
SYBASE 4.2, System 10,  System 11	♦	♦	♦
Teradata 1.0, 2.0		♦	♦
WATCOM 3.0			♦
WATCOM 4.0	♦	♦	♦
Desktop DBMSs			♦
Note:	 A sample file named SP.ER1, which contains a number of useful stored procedures, is shipped with ERwin.


Using the Diagram Editor

Using the Diagram Editor, you can document details about your diagram. You can enter information such as the diagram author, title, definition, target server and version, and specify diagram user-defined properties (UDPs).

ERwin opens the Diagram Editor when you choose Diagram on the Edit menu.

The Diagram Editor includes the following tabs:

•	General. Type the author and title for the diagram and select the target server and version. If the diagram is reverse engineered, the database the diagram was imported from displays.

•	Definition. Type a diagram definition.

•	UDP. Specify a user-defined property value for the diagram.

The purpose of each control in the Diagram Editor is explained below:

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics:

  To create a new ERwin diagram

  To open an existing ERwin file


Specifying Diagram Information

You can use the controls in the General tab of the Diagram Editor to type the name of the author and the diagram title and to select a target server.

The purpose of each control in the General tab is explained below:

•	Author. Type the name of the diagram modeler.

•	Title. Type the title of the diagram.

•	Target Server. Select the target server from the list.

•	Version. Select the version of the targeted server from the list.

•	Imported From. The database from which the diagram was reverse engineered. This information is only displayed when you reverse engineer from a DDL script or database.

Related Topics:

  Using the Diagram Editor

  To specify diagram information

  Reverse Engineering from a DDL Script or Database


To specify diagram information

1.	Choose Diagram on the Edit menu, then click the General tab.

2.	Type the name of the diagram author in the Author text box.

3.	Type the title of the diagram in the Title text box.

4.	Select the targeted database server from the Target Server list.

5.	Select the version of the selected target server from the Version list.

6.	Click OK.


Entering a Diagram Definition

You use the controls in the Definition tab of the Diagram Editor to type a definition for the diagram. The definition that you type should help any person who reads the data model to understand the purpose for the diagram. Follow your organization’s standards and conventions for defining diagrams.

The purpose of each control in the Definition tab is explained below:

•	Definition. Type or edit the entity definition in this box.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Using the Diagram Editor

  To enter a diagram definition


To enter a diagram definition

1.	Choose Diagram on the Edit menu, then click the Definition tab.

2.	Type a definition for the diagram.

3.	Click OK.


Specifying Diagram UDP Values

After you create UDPs for a diagram in the UDP Editor, you can easily specify property values for the diagram in the UDP tab of the Diagram Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP for a table to select a backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Diagram Editor

  To specify diagram UDP values

  Creating User-Defined Properties


To specify diagram UDP values

1.	Define a diagram property. More>>

2.	Select Diagram from the Edit menu.

3.	Click on the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Working with Stored Displays

A stored display is an alternative way to arrange, view, and work on the objects in your diagram. You can create multiple, unique stored displays for each subject area in your diagram.

You create a stored display in the Stored Display Editor, which includes options for changing the display levels and display options for the model. You can vary the display levels and the display options for different analysis or presentation purposes. You can arrange the diagram objects differently in each stored display without affecting the same objects in any other subject area or stored display associated with the diagram. For example, you might want to have a stored display that shows the entity names only in the logical model. Or, you can create a stored display that magnifies the objects for a presentation.

By default, a new data model includes one stored display (Display 1) and one subject area (Main Subject Area). For each stored display you create, ERwin appends a stored display tab to the bottom of the diagram window. You can switch to a different stored display by clicking its tab. If you have multiple subject areas in your diagram, you can create a unique set of stored displays for each subject area. When you switch to a different subject area, you only see the stored display tabs for the current subject area. See Working with Subject Areas for more information.

When you create a stored display for the a logical model, ERwin automatically creates a similar stored display for the physical model and vice-versa. By default, for any stored display options that you set for the logical model, the corresponding physical option automatically applies. If you prefer, you can change the stored display options to be unique for the logical and physical model in the same stored display.

Unlike stored display options, some ERwin display options apply to the whole data model. For example, if you change the background color or the color of an object, the new color applies to every subject area and stored display. Similarly, if you set the width or height of entities, tables, and views to a specific value, the height and width change in every subject area and stored display. See Enhancing the Appearance of an ERwin Diagram  and Editing and Arranging Diagram Objects  for more information.

When you save a diagram as a .er1 file, the stored displays are saved with the diagram, not as individual files. When you open an ERwin diagram, all previously created stored displays are available. See Basic ERwin Features for more information about saving a diagram.

Note:	You can also choose many of the Stored Display options from the ERwin shortcut menus. See Choosing Modeling Preferences and Diagram Display Options for more information.

Related Topics

  Using the Stored Display Editor

  Selecting the Stored Display Options for the Logical Model

  Selecting the Stored Display Options for the Physical Model

  To switch between stored displays

  To rearrange objects in a stored display


Using the Stored Display Editor

You use the Stored Display Editor to save a set of diagram display characteristics for a subject area. In the Stored Display Editor, you can change the display options and display levels for the current subject area. Any changes you make to the graphical appearance or layout of a stored display do not affect any other stored display or subject area in the diagram.

By default, ERwin creates the first stored display for each subject area and names it "Display1". You can change the name using the Stored Display Editor. You can create a new stored display for a subject area simply by entering a name for the stored display setting the display options that you want to apply in both the logical and physical model. When you close the Stored Display Editor, ERwin appends a tab at the bottom of the diagram window for each stored display you create. When you save a data model, ERwin saves all stored displays and subject areas that are associated with the data model in the .er1 file.

Right-click on a blank area of the diagram, then choose Stored Display on the shortcut menu to open the Stored Display Editor.

The purpose of each control in the Stored Display Editor is explained below:

•	Stored Display. Lists all stored displays in the current data model. Select a different stored display in this list to view the associated diagram display characteristics for the logical and physical model.

•	New. Click this button to open the New Stored Display dialog and add a stored display.

•	Rename. Click this button to open the Rename Stored Display dialog and edit the name of the selected stored display.

•	Delete. Deletes the selected stored display.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The Stored Display Editor includes the following tabs:

•	General. Enter common properties for the selected stored display.

•	Logical. Select the display options for the logical model that are saved in the a stored display.

•	Physical. Select the options for the physical model that are saved in the stored display.

•	Definition. Enter or edit a definition for the selected stored display.

•	UDP. Specify a user-defined property value for the stored display.

Note:	If you want to see the stored display tabs at the bottom of the diagram window, select the Stored Display Tabs toggle option on the Windows menu.

Related Topics

  To create a stored display

  To modify a stored display

  To delete a stored display

  To switch between stored displays

  To rearrange objects in a stored display


To create a stored display

1.	Right-click on a blank area of the diagram, then choose Stored Display on the shortcut menu.

2.	Click the New button to open the New Stored Display dialog.

3.	Type a name for the stored display.

4.	Click OK.

5.	Optionally, change the settings on the General, Logical, Physical, or Definition tabs.

6.	Click OK.

Note:	The tabs at the bottom of the ERwin diagram window identify each stored display that you create. If you want to see the stored display tabs at the bottom of the diagram window, choose the Stored Display Tabs toggle on the Windows menu.


To modify a stored display

1.	Right-click on a blank area of the diagram, then choose Stored Display on the shortcut menu.

2.	Select a stored display in the Stored Display list.

3.	Choose one or more of the following options:

•	To rename a stored display, select the stored display that you want to rename from the list and click Rename. Edit the name of the stored display and click OK.

•	To change the characteristics of the stored display, click on the appropriate tabs to change the previously entered information or select new options.

4.	Click OK.


To delete a stored display

1.	Right-click on a blank area of the diagram, then choose Stored Display on the shortcut menu.

2.	Select a stored display in the Stored Display list.

3.	Click Delete.

4.	Click OK.

Note:	When you delete a stored display, the objects that it contained are not deleted.


Specifying Common Properties for a Stored Display

You use the General tab in the Stored Display Editor to enter general information and common properties for the selected stored display. The general information that you select applies to all logical and physical modeling objects that are used in the stored display.

The purpose of each control in the General tab is explained below:

•	Author. Type or edit the name of the person who created the stored display.

•	Logical Model. Select this check box to specify that the stored display is used in the logical model only. Clear this check box to use the stored display in both the logical and physical model. See Switching between the Logical and Physical Model for more information.

•	Show Dangling Relationships. Select this check box to display dangling relationship lines in the stored display. Clear this check box to hide dangling relationship lines. This option is not available in the Main Subject Area.

•	Display Shadows. Select this check box to display the shadow effect for entities, tables, and views in the stored display. Clear this check box to hide the shadow effect for the current stored display. See Adding the Shadow Effect and Selecting Display Option Preferences for more information.

•	Relationship Lines. Select one of the two relationship lines options:

•	Orthogonal. Select this button to display relationships with orthogonal lines which lay at right angles. Traditionally, orthogonal lines are used for ERwin diagrams.

•	Diagonal. Select this button to display relationships with diagonal lines. Traditionally, diagonal lines are used for star schema diagrams in a dimensional model.

Related Topics

  Using the Stored Display Editor

  Displaying or Hiding Dangling Relationships

  To specify common properties for a stored display


Displaying or Hiding Dangling Relationships

When you create a subject area with fewer entities than the Main Subject Area, a stored display for that subject area may include dangling relationships, which are simply relationships for which either the parent or child object (entity, table, or view) is not included in the subject area. Because the Main Subject Area always includes the complete set of entities, it cannot include any dangling relationships.

By default, ERwin hides the relationship line for a dangling relationship. If you want to display dangling relationship lines in a stored display, select the Show Dangling Relationship check box in the General tab in the Stored Display Editor. When you create a subject area that includes dangling relationships, you might find it helpful to display the dangling relationships in one stored display and hide them in another.

Related Topics

  To specify common properties for a stored display


To specify common properties for a stored display

1.	Right-click on a blank area of the diagram, then choose Stored Display on the shortcut menu.

2.	Select a stored display in the Stored Display list.

3.	Click the General tab.

4.	Choose one or more of the following options:

•	To specify an author for the stored display, type the author’s name in the Author text box.

•	To specify that the stored display appears only in the logical model, select the Logical Model check box.

•	To display dangling relationship lines in the stored display, select the Show Dangling Relationships check box.

•	To apply the shadow effect to entities, tables, or views in the stored display, select the Display Shadows check box.

•	To change all relationship lines in the stored display, select Orthogonal for orthogonal lines (right angles), or Diagonal lines.

5.	Click OK.


Selecting the Stored Display Options for the Logical Model

You use the Logical tab in the Stored Display Editor to select the objects and properties that appear in the stored display when the Logical model is selected.

The purpose of each control in the Display Level group box is explained below:

•	Entity. Click this button to use the Entity Display Level for the stored display. The name of each entity appears inside the entity box. See Entity Display Level for more information.

•	Attribute. Click this button to use the Attribute Display Level for the stored display. The primary key and non-key attributes appear inside the entity box. See Attribute Display Level for more information.

•	Definition. Click this button to use the Definition Display Level for the stored display. The entity definition appears inside the entity box. See Definition Display Level for more information.

•	Primary Key. Click this button to use the Primary Key Display Level for the stored display. The primary key attributes for each entity appear inside the entity box. See Primary Key Display Level for more information.

•	Icon. Click this button to use the Icon Display Level (large entity icon) for the stored display. A bitmap appears inside the entity box. See Icon Display Level for more information.

The purpose of each control in the Entity Option group box is explained below:

•	Rolename/Attribute. Select this check box to display the rolename for the attributes in the stored display. Clear this check box to hide basenames of rolenamed attributes. See Rolename/Attribute Display Option for more information.

•	Logical Datatype/Domain. Select this check box to display the logical datatype for the attributes in the stored display. Clear this check box to hide the datatype. See Logical Datatype/Domain Display Option for more information.

•	Primary Key Designator (PK). Select this check box to display the primary key designator (PK) for the attributes in the stored display. Clear this check box to hide the primary key designator. See Primary Key Designator Display Option for more information.

•	Foreign Key Designator (FK). Select this check box to display the foreign key designator (FK) for the attributes in the stored display. Clear this check box to hide the foreign key designator. See Foreign Key Designator Display Option for more information.

•	Alternate Key Designator (AK). Select this check box to display the alternate key (AK) and inversion entry (IE) designator for the attributes in the stored display. Clear this check box to hide the alternate key and inversion entry designator. See Alternate Key Designator Display Option for more information.

•	Show Migrated Attributes. Select this check box to display migrated (foreign key) attributes in the stored display. Clear this check box to hide all migrated attributes, except those that have been assigned a rolename. See Show Migrated Attributes Display Option for more information.

•	Attribute Icon. Select this check box to display attribute icons in the stored display. Clear this check box to hide all attribute icons. See Attribute Icon Display Option for more information.

•	Entity Icon. Select this check box to display entity icons (small entity icon) in the stored display. Clear this check box to hide all entity icons. See Entity Icon Display Option for more information.

The purpose of each control in the Relationship Option group box is explained below:

•	Verb Phrase. Select this check box to display verb phrases for the relationships in the stored display. Clear this check box to hide relationship verb phrases. The options you select in the Stored Display editor override the relationship display options you select in the Preference Dialog. See Verb Phrase Display Option for more information.

•	Cardinality. Select this check box to display cardinality symbols (P, Z, or n) for the relationships in the stored display. Clear this check box to hide relationship cardinality. See Cardinality Display Option for more information.

•	Referential Integrity. Select this check box to display referential integrity symbols (e.g., D:R, U:R, I:R,) for the relationships in the stored display. Clear this check box to hide referential integrity. See Referential Integrity Display Option for more information.

Related Topics

  Using the Stored Display Editor

  To select stored display options

  Changing Logical Display Levels

  Changing Logical Display Options


Selecting the Stored Display Options for the Physical Model

You use the Physical tab in the Stored Display Editor to select the objects that appear in the stored display in the Physical model.

The purpose of each control in the Display Level group box is explained below:

•	Table. Click this button to use the Table Display Level for the stored display. The name of each database table appears inside the table box. See Table Display Level for more information.

•	Column. Click this button to use the Column Display Level for the stored display. The column names appear inside the table box. See Column Display Level for more information.

•	Comment. Click this button to use the Comment Display Level for the stored display. A comment appears inside the table box. See Comment Display Level for more information.

•	Primary Key. Click this button to use the Primary Key Display Level for the stored display. Primary key columns appear inside the table box. See Primary Key Display Level for more information.

•	Physical Order. Click this button to use the Physical Order Display Level for the stored display. Columns appear inside the table box in the order in which they appear in the physical database table. See Physical Order Display Level for more information.

•	Collapse Fact. Click this button to hide Fact table columns in a dimensional model. This option is active only when DM (Dimensional Modeling) notation is selected for your physical model. See Collapse Fact Display Level for more information.

•	Collapse Dimension. Click this button to hide Dimension table columns in a dimensional model. This option is active only when DM (Dimensional Modeling) notation is selected for your physical model. See Collapse Dimension Display Level for more information.

The purpose of each control in the View Option group box is explained below:

•	Views. Select this check box to display views in the stored display. Clear this check box to hide views. See Views Display Option for more information.

•	View Relations. Select this check box to display relationship lines for views in the stored display. Clear this check box to hide view relationship lines. Available when the Views check box is selected. See View Relations Display Option for more information.

•	Column Alias. Select this check box to display the source table alias name for view columns in the stored display. Clear this check box to hide source table alias names. Available when the Views check box is selected. See Column Alias Display Option for more information.

•	Column Datatype. Select this check box to display the physical datatype for view columns in the stored display. Clear this check box to hide the datatypes. Available when the Views check box is selected. See Column Datatype Display Option (View) for more information.

•	Column Null Option. Select this check box to display NULL or NOT NULL values for view columns in the stored display. Clear this check box to hide NULL or NOT NULL values. Available when the Views check box is selected. See Column Null Option Display Option (View) for more information.

The purpose of each control in the Table Option group box is explained below:

•	Datatype. Select this check box to display the physical datatype for columns in the stored display. Clear this check box to hide column datatypes. See Column Datatype Display Option for more information.

•	Domain. Select this check box to display the name of the domain attached to a column after the column name in the stored display. Clear this check box to hide the domain name. See Column Domain Display Option for more information.

•	Null Option. Select this check box to display NULL or NOT NULL values for columns in the stored display. Clear this check box to hide NULL or NOT NULL values. See Null Display Option for more information.

•	PK Designator. Select this check box to display the primary key designator (PK) for columns in the stored display. Clear this check box to hide the primary key designator. See Primary Key Display Level for more information.

•	FK Designator. Select this check box to display the foreign key designator (FK) for columns in the stored display. Clear this check box to hide the foreign key designator. See Foreign Key Designator Display Option for more information.

•	AK Designator. Select this check box to display the alternate key (AK) and inversion entry (IE) designator for columns in the stored display. Clear this check box to hide the alternate key and inversion entry designator. See Alternate Key Designator Display Option for more information.

•	Ungenerated. Select this check box to display tables that will not be generated when you generate the schema. Clear this check box to hide tables that will not be generated. See Ungenerated Tables Display Option for more information.

•	Dimen Icon. Select this check box to display dimensional table icons (Fact, Dimension, and Outrigger) in a dimensional model. Clear this check box to hide dimensional icons. See Dimensional Icon Display Option for more information.

The purpose of each control in the Relationship Option group box is explained below:

•	FK Constraint Name. Select this check box to display the foreign key constraint name (physical relationship name) for relationships in the stored display. Clear this check box to hide foreign key constraint names. See Foreign Key Constraint Name Display Option for more information.

•	Cardinality. Select this check box to display cardinality symbols (P, Z, or n) for the relationships in the stored display. Clear this check box to hide relationship cardinality. See Cardinality Display Option for more information.

•	Referential Integrity. Select this check box to display referential integrity symbols (e.g., U:R, I:R, D:C) for the relationships in the stored display. Clear this check box to hide referential integrity. See Referential Integrity Display Option for more information.

Related Topics

  Using the Stored Display Editor

  To select stored display options

  Changing Physical Display Levels

  Changing Physical Display Options


To select stored display options

1.	Right-click on a blank area of the diagram, then choose Stored Display on the shortcut menu.

2.	Select a stored display in the Stored Display list.

3.	Choose one or more of the following options:

•	To select general display options for the selected stored display, click the General tab.

•	To select logical display options for the selected stored display, click the Logical tab.

•	To select physical display options for the selected stored display, click the Physical tab.

•	To type a stored display definition, click the Definition tab.

•	To enter user-defined property values, click the UDP tab.

4.	Click OK.


Entering a Definition for a Stored Display

You use the Definition tab in the Stored Display Editor to enter or edit a definition for a stored display. The definition that you enter should help any person who reads the data model to understand the purpose for the stored display.

The purpose of each control in the Definition tab is explained below:

•	Definition. Type or edit the stored display definition in this text box.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Using the Stored Display Editor

  To enter or edit a definition for a stored display


To enter or edit a definition for a stored display

1.	Right-click on a blank area of the diagram, then choose Stored Display on the shortcut menu.

2.	Select a stored display in the Stored Display list.

3.	Click the Definition tab.

4.	Type a definition for the stored display. ERwin automatically wraps the text that you type so that it fills the text window.

5.	Click OK.


Specifying Stored Display UDP Values

After you create UDPs for a stored display in the UDP Editor, you can easily specify property values for the stored display in the UDP tab of the Stored Display Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP for you to select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Stored Display Editor

  To specify stored display UDP values

  Creating User-Defined Properties


To specify stored display UDP values

1.	Define a stored display property. More>>

2.	Choose Stored Display on the Edit menu.

3.	Click the UDP tab.

4.	Click the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


To switch between stored displays

•	Click on the stored display tab at the bottom of the diagram window.

Note:	If you want to see the stored display tabs, choose Stored Display Tabs on the Windows menu. In an ERwin diagram, each stored display is associated with only one subject area. If you do not see the stored display tab you want to view, you may need to switch to another subject area. See Switching from One Subject Area to Another for more information.


To rearrange objects in a stored display

1.	Click on the stored display tab, at the bottom of the diagram window, that you want to modify.

2.	Rearrange the graphical objects using any of the ERwin toolbox tools, menu options or features. More>

Note:	If you change the fonts and colors of objects in a stored display, the changes that you make apply to all subject areas and stored displays for the data model.


Dangling Relationship

An incomplete relationship that exists when only the parent or child object (entity, table, or view) is included in the subject area.


Working With the Structured Modeling Language (SML)

Structured Modeling Language (SML) is a text language that is used to define entity relationship models. This language defines ERwin models in much the same way that Structured Query Language Data Definition Language (SQL DDL) defines databases. SML is useful when you are defining models because you can store and transfer the models between different tools that support the SML format.

ERwin provides three editors for working with SML notes:

•	SML Entity Notes Editor. This editor lets you attach SML notes to the entities in your diagram.

•	SML Entity-Attribute Notes Editor. This editor lets you attach SML notes to the attributes in your diagram.

•	SML Relationship Notes Editor. This editor lets you attach SML notes to the relationships in your diagram.

You can also import and export files that you have saved in SML format. SML notes are shared across each of the SML note editors, which means you can attach the same note to different types of objects. For example, if you enter an entity note in the SML Entity Notes Editor, you can view the note in either the SML Entity-Attributes or SML Relationships Editors.

Note:	You can display the SML menu options on the Option menu by selecting the Show SML check box on the Editing Option tab in the Preference dialog. See Selecting List and Menu Preferences for more information.

Related Topics

  Saving a Diagram in SML Format


Adding SML Notes

Enter Structured Modeling Language (SML) notes and attach them to the entities, attributes, and relationships in your diagram. For example, you can attach a note that describes a business rule that you have established. You can attach the notes to one or all of the entities, attributes, or relationships in your diagram.

Related Topics:

  Using the SML Entity Notes Editor

  Using the SML Entity-Attribute Notes Editor

  Using the SML Relationship Notes Editor

  Working With the Structured Modeling Language (SML)


Using the SML Entity Notes Editor

Using the SML Entity Notes Editor, you can create Structured Modeling Language (SML) notes and attach them to the entities in your diagram. For example, you can attach a note that describes a business rule that you have established. You can attach the notes to one or all of the entities in your diagram. Choose SML Entity Note on the Option menu to open the SML Entity Notes Editor.

The purpose of each control in the SML Entity Notes Editor is explained below:

•	Entity. Displays the currently selected entity.

•	Entity List. Displays all entities in your diagram. If necessary, select a different entity from the list.

•	Attached Notes. Displays the sequence number for all notes attached to the current entity.

•	Detach. Detaches the selected notes from the current entity.

•	New. Activates the Note text box so you can add new notes to the current entity.

•	Attach. Attaches new notes to the current entity.

•	Delete. Deletes the selected notes.

•	Exit. Closes the SML Entity Notes Editor without attaching, detaching, or deleting notes.

•	All Notes. Displays the sequence number for all notes that have been attached to all entities in your diagram.

•	Note. Enter or edit a note for the current entity.

Related Topics

  Working With the Structured Modeling Language (SML)

  To attach SML notes to entities


To attach SML notes to entities

1.	Choose SML Entity Note on the Option menu.

2.	Select an entity in the Entity List.

3.	Click the New button.

4.	Enter the note in the Note text box.

5.	Click Attach.

Note:	You can display the SML Entity Note option on the Option menu by selecting the Show SML check box on the Editing Option tab in the Preference dialog.


Using the SML Entity-Attribute Notes Editor

Using the SML Entity-Attribute Notes Editor, you can create SML notes and attach them to the attributes in an entity. For example, you can attach a note that describes the components that make up a specific attribute within an entity. You can attach the notes to one or all of the attributes in an entity. Choose SML Attribute Note on the Option menu to open the SML Entity-Attribute Notes Editor.

The purpose of each control in the SML Entity-Attribute Notes Editor is explained below:

•	Entity. Displays the currently selected entity.

•	Entity-Attribute. Displays all attributes for the current entity. If necessary, select another attribute from the list.

•	Attached Notes. Displays the sequence number for all notes attached to the current attribute.

•	Detach. Detaches the selected notes from the current attribute.

•	New. Activates the Note text box so you can add new notes to the current attribute.

•	Attach. Attaches new notes to the current attribute.

•	Delete. Deletes the selected notes.

•	Exit. Closes the SML Entity-Attribute Notes Editor without attaching, detaching, or deleting notes.

•	All Notes. Displays the sequence number for all notes that have been attached to all attributes in your diagram.

•	Note. Enter or edit a note for the current attribute.

Related Topics

  Working With the Structured Modeling Language (SML)

  To attach SML notes to attributes


To attach SML notes to attributes

1.	Choose SML Attribute Note on the Option menu.

2.	Select an attribute in the Entity-Attribute list.

3.	Click the New button.

4.	Enter the note in the Note text box.

5.	Click Attach.

Note:	You can display the SML Attribute Note option on the Option menu by selecting the Show SML check box on the Editing Option tab in the Preference dialog.


Using the SML Relationship Notes Editor

Using the SML Relationship Notes Editor, you can create SML notes and attach them to the relationships in your diagram. For example, you can attach a note to a relationship to describe the business reason for creating it. You can attach the notes to one or all of the relationships in your diagram. Choose SML Relationship Note on the Option menu to open the SML Relationship Notes Editor.

The purpose of each control in the SML Relationship Notes Editor is explained below:

•	Relationship. Displays all relationships for all entities in your diagram. If necessary, select another relationship from the list.

•	Attached Notes. Displays the sequence number for all notes attached to the current relationship.

•	Detach. Detaches the selected notes from the current relationship.

•	New. Activates the Note text box so you can add new notes to the current relationship.

•	Attach. Attaches new notes to the current relationship.

•	Delete. Deletes the selected notes.

•	Exit. Closes the SML Relationship Notes Editor without attaching, detaching, or deleting notes.

•	All Notes. Displays the sequence number for all notes that have been attached to all relationships in your diagram.

•	Note. Enter or edit a note for the current relationship.

Related Topics

  Working With the Structured Modeling Language (SML)

  To attach SML notes to relationships


To attach SML notes to relationships

1.	Choose SML Relationship Note on the Option menu.

2.	Select a relationship in the Relationship list.

3.	Click the New button.

4.	Enter the note in the Note text box.

5.	Click Attach.

Note:	You can display the SML Relationship Note option on the Option menu by selecting the Show SML check box on the Editing Option tab in the Preference dialog.


Saving a Diagram in SML Format

After you attach SML notes to the entities, attributes, and relationships in your diagram, you can use ERwin to open and save files in SML format. ERwin supports both the .sml and .mps extensions, so you can import and export SML format files with other tools that support this format.

Related Topics

  To open a file in SML format

  To save a diagram in SML format


To open a file in SML format

1.	Choose Open on the File menu.

2.	Change the File Type option to *.mps;*.sml.

3.	Optionally, switch to the directory where the file should be stored.

4.	Select the .mps or .sml file and click OK.

5.	Click Import.

Note:	If an import error occurs, click View Error to examine the content of the error. You can edit the file by clicking the Edit button. Then, you can save the file and import it.


To save a diagram in SML format

1.	Choose SML Report on the Option menu.

2.	Change the File Type option to *.mps;*.sml.

3.	Select the destination directory where the file is stored.

4. 	Enter a name for the file.

5. 	Click OK.


Creating and Assigning Physical Storage Objects

In ERwin, you can define and modify physical storage objects and parameters for your target database using ERwin’s built-in physical object editors. You can create physical storage objects, such as a database, tablespace, and segment for some target servers as well as specify parameters for these objects.

If you reverse engineer a database, the physical storage information is automatically imported into ERwin so you can maintain the original storage assignment for each table or change the parameters as your data model evolves. When you are finished designing the data model, you can generate the physical schema including the new physical storage information.

If you have the appropriate security permissions to create and modify objects on your database, you can use ERwin’s features to create a new physical storage object or modify the parameters for an existing object for some target servers. Once a physical storage object is defined in ERwin, you can assign one or more tables to it. Then when you forward engineer your ERwin data model, the tables are automatically stored in the physical storage object that you specified in ERwin.

Physical object types and parameters differ by target server. For this reason, ERwin provides target server specific physical storage options to help you manage the physical allocation of objects in your database. After you choose your target server, ERwin automatically displays the appropriate physical storage options.

Related Topics

  ERwin Support for Physical Storage Objects

  Summary of Required Server Permissions for Physical Storage Objects

  Using the Physical Object Editor

  Associating ERwin Tables with Physical Storage Objects

  Associating ERwin Indexes with Physical Storage Objects

  Setting Physical Storage Parameters for ERwin Tables


ERwin Support for Physical Storage Objects

The following table summarizes the target servers from which ERwin can reverse engineer storage objects and the target servers to which it can forward engineer new storage objects.

Click on your server in the table below to see a description of the physical storage objects you can define in ERwin.

Server	Reverse Engineer Support	Forward Engineer Support
DB2/MVS Physical Storage Objects	Stogroup Database Tablespace	Stogroup Database Tablespace
DB2/2 Physical Storage Objects	Tablespace	Tablespace
INFORMIX Physical Storage Objects	blobspace dbspace
ORACLE Physical Storage Objects	Tablespace Rollback Segment Database	Tablespace Rollback Segment Database
Red Brick Physical Storage Objects	Segment	Segment
SQL Server/SYBASE Physical Storage Objects	Segment
Teradata Physical Storage Objects	Database	Database
WATCOM/SQL Anywhere Physical Storage Objects	DBSPACE	DBSPACE
Note:	ERwin also supports physical storage parameters for PROGRESS triggers.

Related Topics

  Summary of Required Server Permissions for Physical Storage Objects

  Using the Physical Object Editor


Summary of Required Server Permissions for Physical Storage Objects

The following table shows the physical storage objects that ERwin supports and the server privileges required to manage the physical storage objects.

Click on your server in the table below to see a description of the physical storage objects you can define in ERwin. Click on the Physical Storage Object in the table for a definition of that object.

Server	Physical Storage Objects	Required Permissions  on Server
DB2/MVS	Stogroup  Database  Tablespace	SYSCTRL SYSCTRL SYSCTRL
DB2/2	Tablespace	SYSCTRL
INFORMIX	dbspace  blobspace
ORACLE	Database  Tablespace  Rollback Segment	DBA privileges DBA privileges CREATE ROLLBACK SEGMENT privileges on the corresponding tablespace
Red Brick	Segment	DBA authorization
SQL Server	Segment
SYBASE	Segment
Teradata	Database	CREATE DATABASE privileges on the immediate owner database or user area
WATCOM/SQL Anywhere	DBSPACE	DBA authority
Related Topics

  Using the Physical Object Editor


Using the Physical Object Editor

In the Physical Object Editor, you can create, modify, and delete storage objects and modify physical storage parameters supported by your target server. Although these physical parameters can be defined using tools provided by the server manufacturer, you can use ERwin’s built-in editors to manipulate these settings in the same environment in which you design the physical model for the database.

When you choose Physical Object on the Server menu, ERwin displays the Physical Object Editor.

The controls in the Physical Object Editor vary by target server, except for the common controls which are explained below:

•	DB Sync. Click this button to start the Complete Compare task, so you can synchronize the physical storage objects defined in your data model with the information stored on the server. See Using the DB Sync Button for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Note:	ERwin supports a limited synchronization (name only) of physical storage objects. If you import a physical storage object and rename it, ERwin cannot export the name change, although it can export the information to create a new object.

ERwin does not compare or synchronize index physical properties, table physical properties, or synonyms.

Click on your target server in the list below to see a description of the physical storage objects that you can define in ERwin:

•	DB2/MVS Physical Storage Objects

•	DB2/2 Physical Storage Objects

•	INFORMIX Physical Storage Objects

•	ORACLE Physical Storage Objects

•	Red Brick Physical Storage Objects

•	SQL Server/SYBASE Physical Storage Objects

•	Teradata Physical Storage Objects

•	WATCOM/SQL Anywhere Physical Storage Objects

Related Topics

  To create a physical storage object

  To change physical storage object parameters

  To rename a physical storage object

  To delete a physical storage object


To create a physical storage object

1.	Choose <Database> Physical Object from the Server menu.

2.	If your server supports multiple physical objects, click on the correct tab for the object type that you want to create (e.g., Tablespace).

3.	Click the New button.

4.	Enter a valid name in the Name text box and then click OK. See your server documentation for restrictions on naming physical storage objects.

5.	Enter a value for each parameter you want to define for the new object. When you create a physical object in ERwin, any parameters you leave blank are automatically assigned a default value by the target server. For more information on setting physical storage parameters, consult the documentation that comes with your DBMS.

6.	When you are finished editing all the physical parameter settings, click OK.

Note:	If your target server is DB2/MVS, ORACLE, Red Brick, SQL Anywhere, Teradata, or WATCOM/SQL Anywhere you can forward engineer the storage objects when you generate the database schema. To physically create storage objects defined in ERwin on the server, select Forward Engineer/Schema Generation from the Tasks menu and check the physical storage object options in the Schema Options group on the Schema Generation Report Options dialog to specify which physical storage objects you want to generate as part of the database schema. Then click the Generate button to generate the schema.


To change physical storage object parameters

1.	Choose <Database> Physical Object from the Server menu.

2.	If your server supports multiple physical storage objects, click on the tab for the object type that you want to modify (e.g., Tablespace).

3.	To change the value for a particular physical storage object parameter, click on the appropriate control and edit the existing value.

4.	When you are finished editing all the physical storage object parameter settings, click OK.

Note:	ERwin supports a limited synchronization (name only) of physical storage objects. If you import a physical storage object and rename it, ERwin cannot export the name change, although it can export the information to create a new object.

ERwin does not compare or synchronize index physical properties, table physical properties, or synonyms.


To rename a physical storage object

1.	Choose <Database> Physical Object from the Server menu.

2.	If your server supports multiple physical objects, click on the tab for the object type that you want to rename (e.g., Tablespace).

3.	Select the physical object from the list.

4.	Click the Rename button.

5.	Edit the physical object name in the Name box and then click OK. See your server documentation for restrictions on naming physical storage objects.

6.	Click OK.


To delete a physical storage object

1.	Choose <Database> Physical Object from the Server menu to open the Physical Object Editor for the current target server.

2.	If your server supports multiple physical storage objects, click on the tab for the object type that you want to delete (e.g., Tablespace).

3.	Select the object from the list that you want to delete and then press the Delete button.

4.	Click OK.


Nesting Storage Objects

For some target servers, certain physical storage objects can be nested inside other storage objects. When you create or modify an object that can be nested in another object, the Physical Object Editor displays all the valid parent storage objects in a list box. Open the list box and click on the parent object in which you want to nest the child object.

Related Topics

  Using the Physical Object Editor

  DB2/MVS Physical Storage Objects

  ORACLE Physical Storage Objects


DB2/MVS Physical Storage Objects

Using the STOGROUP tab of the DB2 Physical Object Editor, you can create and define the properties for one or more stogroups in which to store database objects. The purpose of each control in the STOGROUP tab is explained below:

•	STOGROUP. Displays all of the available stogroups in the active model. You can create a new stogroup using the New STOGROUP dialog.

•	New. Click this button to open the New STOGROUP dialog and add a stogroup name.

•	Rename. Click this button to open the Rename STOGROUP dialog and edit the name of the selected stogroup.

•	Delete. Deletes the selected stogroup.

•	VOLUMES. Displays the serial numbers of all the devices for the selected stogroup.

•	Add. Click this button to add a device volume serial number for the selected stogroup.

•	Remove. Select a serial number in the Volumes list and click this button to remove it as a device serial number for the selected stogroup.

•	VCAT. Displays the ICF catalog used for space allocation.

•	PASSWORD. Displays the Password for the ICF catalog.

The DB2 Physical Object Editor also includes the following tabs:

•	DATABASE

•	TABLESPACE

Related Topics

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object

  Nesting Storage Objects


DB2/MVS Database

Using the DATABASE tab of the DB2 Physical Object Editor, you can create and define the properties for a database in which to store database objects. The purpose of each control in the DATABASE tab of the DB2 Physical Object Editor is explained below:

•	DATABASE. Displays all of the databases defined as physical storage objects in the active model. You can create a new database using the New DATABASE dialog.

•	New. Click this button to open the New DATABASE dialog and add a database name.

•	Rename. Click this button to open the Rename DATABASE dialog and edit the name of the selected database.

•	Delete. Deletes the selected database.

•	BUFFERPOOL. Specifies the Bufferpool that the currently selected database uses. BP0 to BP49 are for tables with 4 KB page sizes. BP32K, and BP32K1 to BP32K9 are for tables with 32 KB page sizes.

•	ROSHARE. Select this check box to indicate that the database is shared. If this option is selected, you can also specify the following options:

•	OWNER. Click this button to specify that the local DB2/MVS subsystem is the owner of the database.

•	READ. Click this button to specify that the local DB2/MVS subsystem is a read-only user of the database.

•	STOGROUP. Displays the name of the stogroup that contains the currently selected database. Select a different stogroup from the list to store the database in another stogroup.

The DB2 Physical Object Editor also includes the following tabs:

•	STOGROUP

•	TABLESPACE

Related Topics

  Using the Physical Object Editor

 To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object

  Nesting Storage Objects


DB2/MVS Tablespace

Using the TABLESPACE tab of the DB2 Physical Object Editor, you can create and define the properties for a tablespace in which to store database objects. The purpose of each control in the TABLESPACE tab of the DB2 Physical Object Editor is explained below:

•	TABLESPACE. Displays all of the available tablespaces in the current model. You can create a new tablespace using the New TABLESPACE dialog.

•	New. Click this button to open the New TABLESPACE dialog and add a tablespace name.

•	Rename. Click this button to open the Rename TABLESPACE dialog and edit the name of the selected tablespace.

•	Delete. Deletes the selected tablespace.

•	IN. Select the database you want to contain the selected tablespace.

•	USING. Click this button to specify additional parameters for the Using Clause of the CREATE TABLESPACE statement in the schema. See USING for more information.

•	Simple. Click this button to specify that the tablespace will not be divided into partitions or segments.

•	NUMPARTS. Click this button to specify the number of partitions for the current tablespace.

•	PART. Click the PART button to specify the partition parameters in the Using Clause of the CREATE TABLE statement.

•	SEGSIZE. Click this button to specify the number of segments for the current tablespace.

•	DSETPASS. Enter the password for the data sets in a tablespace.

•	BUFFERPOOL. Select a value for the Bufferpool for the currently selected tablespace. BP0 to BP49 are for tables with 4 KB page sizes. BP32K, and BP32K1 to BP32K9 are for tables with 32 KB page sizes.

•	LOCKSIZE. Select this check box to specify the locking rules for objects in the current tablespace. Select one or more of the following lock options to apply to the current tablespace.

•	ANY. Select this option to indicate that DB2 can use any lock size.

•	TABLE. Select this option to specify table-level locks. This option applies only for a segmented tablespace.

•	TABLESPACE. Select this option to specify tablespace-level locks.

•	PAGE. Select this option to specify page-level locks.

•	ROW. Select this option to specify row-level locks.

•	LOCKMAX. Enter the maximum number (0 - 2,147,483,647) of page or row locks an application process can hold simultaneously in the tablespace. If the program requires more locks than the number entered, the locks are escalated, unless you enter 0 (zero).

•	CLOSE. Select this check box to specify that the data sets associated with the current tablespace are candidates for closure when the limit on the number of open data sets is reached.

•	COMPRESS. Select this option to specify whether data compression applies to the rows of the tablespace or partition.

The DB2 Physical Object Editor also includes the following tabs:

•	STOGROUP

•	DATABASE

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object

  Nesting Storage Objects


Specifying Additional Parameters for DB2/MVS Create Tablespace

You can specify additional physical storage parameters in the Using Clause of the CREATE TABLESPACE statement in the schema for DB2/MVS target servers.

When you click the USING button or the PART button in the DB2 Physical Object Editor, ERwin opens the Using Clause dialog. The purpose of each control in the Using Clause dialog is explained below:

•	PART. Select the partition from the list to which you want the tablespace parameters in the Using Clause to apply. This list does not appear if you clicked the USING button in the DB2 Physical Object Editor.

•	USING. Select this checkbox to specify the space allocation parameters in the Using Clause of the CREATE TABLESPACE statement.

•	VCAT. Click this button to display the ICF catalog used for space allocation.

•	STOGROUP. Click this button to select the storage group that contains the tablespace. If you select this option, you can specify the primary and secondary space allocation parameters. In addition, you can specify whether or not to erase dropped data sets.

•	PRIQTY. Enter the primary space allocation in units of 1 KB storage blocks for the current STOGROUP. This option is available only when you select the STOGROUP check box.

•	SECQTY. Enter Secondary space allocation in units of 1 KB storage blocks for the current STOGROUP. This option is available only when you select the STOGROUP check box.

•	ERASE. Select this check box to specify to erase dropped data sets. This option is available only when you select the STOGROUP check box.

The purpose of each control in the Free group box is explained below:

•	FREEPAGE. Enter the number of pages that are loaded before a page is left as free space.

•	PCTFREE. Enter the percentage of each subpage or nonleaf page that is left as free space.

•	COMPRESS. Select this option to specify whether data compression applies to the rows of the tablespace or partition.

Related Topics

  DB2/MVS Tablespace


DB2/2 Physical Storage Objects

Using the DB2/2 Physical Object Editor, you can create a tablespace in which to store DB2/2 database objects. The purpose of each control in the DB2/2 Physical Object Editor is explained below:

•	TABLESPACE. Displays all of the available tablespaces in the active model. You can create a new tablespace using the New TABLESPACE dialog.

•	New. Click this button to open the New TABLESPACE dialog and add a tablespace name.

•	Rename. Click this button to open the Rename TABLESPACE dialog and edit the name of the selected tablespace.

•	Delete. Deletes the selected tablespace.

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object

  Nesting Storage Objects


INFORMIX Physical Storage Objects

Using the Inform Physical Object Editor, you can select a dbspace in which to store INFORMIX database tables. The purpose of each control in the INFORMIX Physical Object Editor is explained below:

•	dbspace. Displays all of the available dbspaces in the active model.

•	New. Click this button to open the New dbspace dialog and add a dbspace name.

•	Rename. Click this button to open the Rename dbspace dialog and edit the name of the selected dbspace.

•	Delete. Deletes the selected dbspace.

Note:	Although you can enter a name for a new dbspace and view the names of existing dbspaces in the INFORMIX Physical Object Editor, you cannot generate a dbspace from ERwin. In order to actually create a dbspace, you must use the native tools supplied by INFORMIX for this purpose.

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object


ORACLE Physical Storage Objects

Using the TABLESPACE tab of the ORACLE Physical Object Editor, you can create and define parameters for tablespaces as physical storage objects. The purpose of each control in the TABLESPACE tab of the ORACLE Physical Object Editor is explained below:

•	TABLESPACE. Displays all of the available tablespaces in the database. You can create a new database using the New TABLESPACE dialog.

•	New. Click this button to open the New TABLESPACE dialog and add a tablespace name.

•	Rename. Click this button to open the Rename TABLESPACE dialog and edit the name of the selected tablespace.

•	Delete. Deletes the selected tablespace.

•	DATAFILE. Displays all of the data files in the selected tablespace. You can enter or edit a data file for the selected tablespace.

•	OFFLINE. Select this check box to take the tablespace off-line. Clear the check box if you want to work online.

•	TEMPORARY. Select this check box to indicate that the selected tablespace is only intended to hold temporary objects, for example, segments used by implicit sorts to handle ORDER BY clauses. This option is only available when ORACLE version 7.3 is the selected target server.

•	INITIAL. Enter the size of the initial extent in bytes.

•	NEXT. Enter the size of the next extent in bytes.

•	PCTINCREASE. Enter the percent by which an extent can exceed the size of its immediate predecessor.

•	MINEXTENTS. Enter the minimum number of extents that are automatically allocated when you create a table, index, or cluster in the tablespace.

•	MAXEXTENTS. Enter the maximum number of extents that can be allocated to a table, index, or cluster in the tablespace.

The ORACLE Physical Object Editor also includes the following tabs:

•	ROLLBACK SEGMENT

•	DATABASE

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object

  Defining Oracle 8.x Table Partitions

  Nesting Storage Objects


ORACLE Rollback Segment

Using the ROLLBACK SEGMENT tab of the ORACLE Physical Object Editor, you can create and define parameters for rollback segments as physical storage objects. The purpose of each control in the ROLLBACK SEGMENT tab of the ORACLE Physical Object Editor is explained below:

•	ROLLBACK SEGMENT. Displays all of the available rollback segments in the current model. You can create a new rollback segment using the New ROLLBACK SEBMENT dialog.

•	New. Click this button to open the New ROLLBACK SEGMENT dialog and add a rollback segment name.

•	Rename. Click this button to open the Rename ROLLBACK SEGMENT dialog and edit the name of the selected rollback segment.

•	Delete. Deletes the selected rollback segment.

•	TABLESPACE. Displays the filenames of all tablespaces in the database. Scroll through the list to select the tablespace that you want to contain the rollback segment.

•	PUBLIC. Select this check box to make the rollback segment available to any instance. Clear the check box if you want the rollback segment to be available to one specific instance.

•	INITIAL. Enter the size of the initial extent in bytes.

•	NEXT. Enter the size of the next extent in bytes.

•	OPTIMAL. Enter the optimum number of extents to maintain in each rollback segment. Oracle automatically resets rollback segments back to the OPTIMAL size setting when the transaction is completed successfully.

•	MINEXTENTS. Enter the minimum number of extents that are automatically allocated when you create a rollback segment.

•	MAXEXTENTS. Enter the maximum number of extents that can be allocated to the rollback segment.

The ORACLE Physical Object Editor also includes the following tabs:

•	TABLESPACE

•	DATABASE

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object

  Nesting Storage Objects


ORACLE Database

Using the DATABASE tab of the ORACLE Physical Object Editor, you can create and specify parameters for a database defined as a physical storage object. The purpose of each control in the DATABASE tab of the ORACLE Physical Object Editor is explained below:

•	DATABASE. Displays all of the available databases defined as physical storage objects for the current database. You can create a new database physical storage object using the New DATABASE dialog.

•	New. Click this button to open the New DATABASE dialog and add a database name.

•	Rename. Click this button to open the Rename DATABASE dialog and edit the name of the selected database.

•	Delete. Deletes the selected database.

•	LOGFILE. Select the filename of a redo log file in the database to set or view its properties which include:

•	MAXLOGFILES. Enter the maximum number of log groups that can be created for the databases.

•	MAXLOGHIST. Enter the amount of space to be reserve in the control file for names of archived transaction log groups (supported in Oracle7 and later versions).

•	MAXLOGMEMS. Enter the maximum number of members in each log group (supported in Oracle7 and later versions).

•	DATAFILE. Select the filename of a data files in the database to set or view its properties which include:

•	MAXDATAFILES. Enter the maximum number of data files that can be allocated for the database.

•	CONTROL FILE REUSE. Select this check box to let Oracle overwrite information in control files identified in the INIT.ORA CONTROL_FILES parameter. Clear the check box if you do not want Oracle to reuse control files.

•	ARCHIVE LOG. Select this check box enable automatic archiving of redo log information. Clear the check box if you do not want to use automatic archiving.

•	EXCLUSIVE. Select this check box to specify that only one instance can access the database at a time. Clear the check box to allow simultaneous access by multiple instances.

•	MAXINSTANCES. Enter the maximum number of instances that can be simultaneously mounted in the database.

•	CHARACTER SET. Enter the character set value for all data to be stored in columns defined as CHAR, VARCHAR2, and LONG datatypes. After you create the database, the character set cannot be changed. In the United States, the default character set is generally US7ASCII.

The ORACLE Physical Object Editor also includes the following tabs:

•	TABLESPACE

•	ROLLBACK SEGMENT

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object

  Nesting Storage Objects


Defining ORACLE 8.x Table Partitions

In Oracle 8.x, you can use the Partitions tab in the Table Editor to assign table columns to specific physical partitions. For each partition, you can define table partition segment attributes.

The purpose of each control in the Partitions tab is explained below:

•	Available Columns. Lists the available table columns for partitioning.

•	Selected Columns. Lists columns you select for partitioning.

•	. Moves the highlighted column in the Available Columns list to the Selected Columns list.

•	. Moves the highlighted column in the Selected Columns list to the Available Columns list.

•	Partitions. Specify partition information, row by row:

•	. Adds a new row in the grid.

•	. Deletes the selected row in the grid.

•	Name. Type the name for each partition when you open a new row.

•	<column name>. Lists each column in the Selected Columns list. Type the non-inclusive upper bound value (VALUE LESS THAN), or select MAXVALUE from the <column name> list. MAXVALUE specifies an ORACLE maximum value that will always sort higher than any other value, including NULL.

•	Segment Attributes. The TABLESPACE button opens the Oracle Table Partition Segment Attributes Editor.

Related Topics

  To define ORACLE 8.x table partitions

  Defining ORACLE 8.x Table Partition Segment Attributes

  ORACLE Table Physical Storage Properties


To define ORACLE 8.x table partitions

1.	Right-click a diagram table.

2.	Choose Table Editor on the shortcut menu, then choose Partitions on the submenu.

3.	In the Oracle Table Editor Available Columns list, double-click the columns you want to add to a partition.

4.	In the Partitions list, click the [image] to open a new row.

5.	Enter the partition information for each text box in the Partitions grid:

•	Name. Type the name of the partition.

•	<column name>. For each column you select, type the non-inclusive upper bound value (VALUE LESS THAN) or select MAXVALUE from the <column name> list.

•	Segment Attributes. Click the TABLESPACE button to define table partition segment properties in the Oracle Table Partition Segment Attributes Editor. More>>

6.	Repeat steps 4 and 5 for each partition.

7.	Click OK.


Defining ORACLE 8.x Table Partition Segment Attributes

In the Oracle Table Editor Partitions tab, which is only available when Oracle 8.x is your target server, you can select table columns for partitioning and click the TABLESPACE button in the Partitions group box to open the Oracle Table Partition Segment Attributes Editor. In this editor, you can set the table physical partition properties. The partition segment properties you set in the Table Partition Segment Attributes Editor override the table physical properties that you set in the Physical Props tab tab of the Table Editor.

The partition segment properties you can assign are identical to those you assign in the Physical Props tab of the Table Editor. The partition segment properties however, apply only to the specific partition, and not the entire table.

Related Topics

  To modify ORACLE 8.x table partition segment attributes

  Defining ORACLE 8.x Table Partitions

  ORACLE Physical Storage Objects


To modify ORACLE 8.x table partition segment attributes

1.	Right-click on a diagram table.

2.	Choose Table Editor on the shortcut menu and then choose Partitions on the submenu.

3.	Select the table columns and assign the partitions. More>>

4.	Click the TABLESPACE button to open the ORACLE Table Partition Segment Attributes Editor.

5.	Type or edit any of the partition segment attribute values. More>>

6.	Click OK.


Red Brick Physical Storage Objects

Using the Red Brick Physical Object Editor, you can create one or more segments in which to store database objects.

The purpose of each control in the Red Brick Physical Object Editor is explained below:

•	Segment. Displays all of the available segments in the active model. You can create a new segment using the New SEGMENT dialog.

•	New. Click this button to open the New SEGMENT dialog and add a segment name.

•	Rename. Click this button to open the Rename SEGMENT dialog and edit the name of the selected segment.

•	Delete. Deletes the selected segment.

•	FILENAME/MAXSIZE. Displays the filename and maximum size (in kilobytes) for the selected segment.

•	FILENAME. Enter the path and filename of the file that contains row data or index data for the segment.

•	MAXSIZE. Enter the maximum number of kilobytes of data that are loaded into the segment before the next segment in the sequence is used. This parameter is ignored for PATTERN indexes.

•	INITSIZE. Enter the amount of initial space allocated for the segment. The initial size of the first segment must be greater than 16 KB.

•	EXTENDSIZE. Enter the amount the segment expands beyond the initial size each time it becomes full.

Note:	Once a segment has been created on SQL Server, you can associate ERwin tables with it using the ERwin Table Editor. See Associating ERwin Tables with Physical Storage Objects for more information.

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object


SQL Server/SYBASE Physical Storage Objects

Using the SQL Server or SYBASE Physical Object Editor, you can select one or more segments in which to store database objects for a Microsoft SQL Server or SYBASE target server.

The purpose of each control in the SQL Server Physical Object Editor is explained below:

•	Segment. Displays all of the available segments in the active model.

•	New. Click this button to open the New Segment dialog and add a segment name.

•	Rename. Click this button to open the Rename Segment dialog and edit the name of the selected segment.

•	Delete. Deletes the selected segment.

Note:	Once a segment has been created on SQL Server, you can associate ERwin tables with it using the ERwin Table Editor. See Associating ERwin Tables with Physical Storage Objects for more information.

Although you can enter a name for a new segment and view the names of existing segments in the SQL Server or SYBASE Physical Object Editor, you can’t generate a segment using ERwin. To generate a segment to SQL Server or SYBASE, you must use the sp_addsegment stored procedure.

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object


Teradata Physical Storage Objects

Using the Teradata Physical Object Editor, you can create one or more databases in which you want to store other Teradata database objects.

The purpose of each control in the Teradata Physical Object Editor is explained below:

•	DATABASE. Displays all of the available databases in the active model. You can create a new database physical storage object using the New DATABASE dialog.

•	New. Click this button to open the New DATABASE dialog and add a database name.

•	Rename. Click this button to open the Rename DATABASE dialog and edit the name of the selected database.

•	Delete. Deletes the selected database.

•	FROM. Enter the name of the immediate owning user/database.

•	AS PERM. Enter the number of bytes reserved as permanent storage space for the database. The space is taken from unallocated space in the owning database.

•	FALLBACK PROTECTION. Select this check box to create a duplicate fallback copy of tables in the current database. Clear the check box to store a single copy of all tables.

•	SPOOL. Enter the number of bytes to allocate for spool files.

•	ACCOUNT. Enter an identifier for the account charged for the space used by the database.

•	DEFAULT JOURNAL. Enter the location of default journal. Enter the name of the database and table in which journal images are stored (e.g., MOVIES.JOURNAL).

•	JOURNAL. Select the default journaling options you want to use for each table or database. When you choose JOURNAL, BEFORE JOURNAL, or AFTER JOURNAL from the list, ERwin displays additional controls that lets you maintain zero (NO), 1(---), or 2 (DUAL) before and/or after change images.

•	COMMENT. Description of the current database (optional).

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object


WATCOM/SQL Anywhere Physical Storage Objects

Using the WATCOM or SQL Anywhere Physical Object Editor, you can create one or more dbspaces in which to store database objects. The purpose of each control in the WATCOM/SQL Anywhere Physical Object Editor is explained below:

•	DBSPACE. Displays the name of each DBSPACE in the active model. You can create a new dbspace using the New DBSPACE dialog.

•	File. Enter the name of the file that you want to contain the selected dbspace.

•	New. Click this button to open the New DBSPACE dialog and add a dbspace.

•	Rename. Click this button to open the Rename DBSPACE dialog and edit the name of the selected dbspace.

•	Delete. Click on this button to delete the selected dbspace.

Related Topics

  Using the Physical Object Editor

  To create a physical storage object

  To change a physical storage object parameter

  To rename a physical storage object

  To delete a physical storage object


Setting Physical Storage Parameters for ERwin Tables

When you reverse engineer a database, ERwin imports any existing physical storage objects (of a supported type) as part of the data model. For example, when you reverse engineer an ORACLE database, ERwin imports the names of any tablespaces already defined on the server. You can view a physical storage object imported into ERwin and change its parameters in the Physical Object Editor in the same manner you view or modify a physical storage object created in ERwin.

When you generate a database schema, ERwin can create the physical storage objects defined in ERwin as part of the schema and generate the physical database tables and indexes in the specified storage objects. For example, if you forward engineer an ORACLE database, ERwin can create any tablespaces that you defined in the Physical Object Editor and then generate tables in a particular tablespace according to the associations you’ve made in the Table Editor.

Regardless of whether you create physical storage objects on the server using ERwin or another tool, in ERwin, you can control the storage location for database tables generated by ERwin. In this way, ERwin helps you control how storage space on the server is utilized. If necessary, you can also tune database performance by modifying the parameters associated with a particular storage object or table or index location.

Note:	Not all DBMS’s support forward engineering of physical storage objects. See ERwin Support for Physical Storage Objects for more information.

Related Topics

  Associating ERwin Tables with Physical Storage Objects

  To assign an ERwin table to a physical storage object


Associating ERwin Tables with Physical Storage Objects

In the Physical Props tab in the Table Editor, you can view and modify various physical properties including the physical storage parameters associated with each table in the active model.

When you select a physical storage object in which to store a table, the default or current parameters for that object are displayed with the table. So, when you view a table in the Table Editor, you can see the associated table name and the physical object in which the table is stored, and you can modify the parameters for that physical storage object. You can also increase or decrease the space available for the selected table, create space to store additional tables in the same physical object, or modify the size of storage objects as they are created.

Click on your target server in the list below to see a description of the physical storage properties that ERwin supports at the table level:

•	DB2/MVS Table Physical Storage Properties

•	DB2/2 Table Physical Storage Properties

•	INFORMIX Table Physical Storage Properties

•	ORACLE Table Physical Storage Properties

•	PROGRESS Table Physical Storage Properties

•	Red Brick Table Physical Storage Properties

•	SQL Server/SYBASE Table Physical Storage Properties

•	Teradata Table Physical Storage Properties

•	WATCOM/SQL Anywhere Table Physical Storage Properties

Related Topics

  To assign an ERwin table to a physical storage object

  To modify the storage parameters for a table

  Using the Table Editor


DB2/MVS Table Physical Storage Properties

In the Physical Prop tab of the DB2/MVS Table Editor, you can assign a table generated by ERwin to a database and tablespace.

The purpose of each DB2/MVS physical storage property that you can set for a table is explained below:

•	IN DATABASE. Select a database where you want to store the current table from the list.

•	. Click this button to open the DB2/MVS Physical Object Editor to create a new database.

•	IN TABLESPACE. Select the tablespace partition where you want to store the current table.

•	 Click this button to open the DB2/MVS Physical Object Editor to create a new tablespace.

•	EDITPROC. Enter the name of an edit procedure.

•	OBID. Enter the internal identifier for the selected table.

•	AUDIT. Select this check box, then check one of the auditing option buttons. Auditing determines if the security plan is working and who has access to the table data. Choose:

•	CHANGES. Click this button to audit only changes to the data.

•	ALL. Click this button to audit all access to the data.

•	DATA CAPTURE CHANGES. Select this check box to store information about SQL updates to the selected table in the log file.

Related Topics

  DB2/MVS Physical Storage Objects

  To assign an ERwin table to a physical storage object

  To modify the storage parameters for a table

  Using the Table Editor


DB2/2 Table Physical Storage Properties

In the Physical Props tab of the DB2/2 Table Editor, you can assign a table generated by ERwin to a tablespace and database.

The purpose of each DB2/2 physical storage property that you can set for a table is explained below:

•	TABLE TABLESPACE. Select a tablespace from the list where you want the current table to be stored.

•	INDEX TABLESPACE. Select the tablespace from the list where you want the index tables for the current table to be stored.

•	LONG TABLESPACE. Select the tablespace from the list where you want the long column values for the current table to be stored (e.g., LONG VARCHAR, LONG VARGRAPHIC, LOB).

•	 Click this button to open the DB2/2 Physical Object Editor and create new tablespaces.

Related Topics

  DB2/2 Physical Storage Objects

  To assign an ERwin table to a physical storage object

  Using the Table Editor


INFORMIX Table Physical Storage Properties

In the Physical Props tab of the INFORMIX Table Editor, you can assign a table generated by ERwin to a tablespace and database.

The options shown in the center of the INFORMIX Physical Property tab vary depending on which button is selected in the Storage Option section.

The purpose of each INFORMIX physical storage property that you can set for a table is explained below:

•	Storage Option. Select this check box to specify the table storage properties. When you select the Storage Option check box, you can select one of the following storage methods for the current table.

•	IN dbspace. Click this button to assign the current table to an existing dbspace or blobspace. When you click the IN dbspace button, you can choose from the dbspace list.

•	dbspace. Select the dbspace to which you want to assign the current table.

•	. Click this button to open the INFORMIX Physical Object Editor and create a new dbspace.

•	IN pathname. Click this button to enter a UNIX or DOS pathname specifying where you want to store the current table. When you click the IN pathname button, you can enter the pathname for the current table.

•	pathname. Enter the pathname to identify where you want to store the current table.

•	FRAGMENT BY ROUND ROBIN. Click this button to apply INFORMIX round robin fragmentation (partitioning) to the current table. Round robin fragmentation evenly distributes the rows in the table among two or more dbspaces. When you choose this button, you can choose additional options:

•	IN dbspace (list box). When you choose the FRAGMENT BY ROUND ROBIN option, ERwin displays a list of the dbspaces associated with the current table.

•	dbspace (list). Displays a list of all existing dbspaces. Select the dbspace you want to associate with the selected table.

•	. Click this button to open the INFORMIX Physical Object Editor and define a new dbspace.

•	New. Click this button to add the expression in the expression box to the expression/IN dbspace list.

•	Update. Click this button to change the expression selected in the expression/IN dbspace list.

•	Delete. Deletes the expression selected in the expression/IN dbspace list.

•	FRAGMENT BY EXPRESSION. Click this button to fragment the current table by defining one or more row selection expressions. You can use this option to assign a specific storage location for all the rows that match a given row selection expression. For example, for the video store data base, you can define INFORMIX expressions that store all the “comedy” rows in the MOVIE table in one dbspace and all “drama” rows in a different dbspace. When you choose this button, you can choose additional options:

•	expression/IN dbspace. Displays the expression used to select rows from the current table and the dbspace in which the selected rows will be stored.

•	New. Click this button to add the expression in the expression box to the expression/IN dbspace list.

•	Update. Click this button to change the expression selected in the expression/IN dbspace list.

•	Delete. Deletes the expression selected in the expression/IN dbspace list.

•	expression. Enter the expression that you want to use to select rows from the current table.

•	dbspace (list box). Select the dbspace in which to store the rows selected by the expression in the expression/IN dbspace list.

•	. Click this button to open the INFORMIX Physical Object Editor and create a new dbspace.

•	REMAINDER IN (list). Select the dbspace in which to store the rows that are not selected by any expression in the expression/IN dbspace text box.

The purpose of each control in the EXTENT group box is explained below:

•	EXTENT SIZE and NEXT SIZE. Enter a number to specify physical table sizing parameters. You can enter both the original extent size and the next size in Kbytes. If you leave the EXTENT SIZE and NEXT SIZE fields blank, ERwin assigns the INFORMIX default value for the extent and next extent, which is equal to eight times the system page size.

The purpose of each control in the LOCK group box is explained below.

•	LOCK. Select this check box to specify the locking mode for the current table during schema generation. Clear the LOCK check box to specify no locking mode for the current table. If you choose to lock the table, you can choose to lock by page or by row.

•	PAGE. Click this button to lock the current table by page.

•	ROW. Click this button to lock the current table by row.

•	ROWIDS. Select this check box to assign each row in the ROWID column a unique number that remains stable for the life of the row. The database server uses an index to find the physical location of the row.

Related Topics

  INFORMIX Physical Storage Objects

  To assign an ERwin table to a physical storage object

  To modify the storage parameters for a table

  To fragment an INFORMIX table by round robin

  To fragment an INFORMIX table by expression


To fragment an INFORMIX table by round robin

1.	Right-click on the table that you want to fragment, click Table Editor on the shortcut menu, then click the Physical Props tab.

2.	Click Storage Option.

3.	In the FRAGMENT BY group box, click the ROUND ROBIN button.

4.	Select a dbspace from the dbspace list box. ERwin adds the dbspace to the IN dbspace list.

5.	Repeat Step 4 until the IN dbspace list contains all the dbspaces in which you want to store rows of the current table.

6.	Click OK.

Note:	Click the New button to add a selected dbspace to the IN dbspace. Use the Update and Delete buttons to modify or delete dbspaces from the IN dbspace list.


To fragment an INFORMIX table by expression

1.	Right-click on the table that you want to fragment, click Table Editor on the shortcut menu, then click the Physical Props tab.

2.	Click Storage Option.

3.	In the FRAGMENT BY group box, click the EXPRESSION button.

4.	Enter the expression that you want to use to select different rows in the expression text box. Then select the dbspace that you want to assign to the expression from the dbspace list.

5.	Click the New button to add the expression and the dbspace to the expression/IN dbspace list.

6.	Repeat Steps 4 and 5 until you enter all the expressions that you want to use to fragment the table.

7.	Optionally, select a different dbspace from the REMAINDER IN box to store non-matching rows.

8.	Click OK.

Note:	Use the Update and Delete buttons to modify or delete entries in the expression list.


ORACLE Table Physical Storage Properties

In the Physical Props tab of the ORACLE Table Editor, you can assign a table to a tablespace and set the table’s physical storage properties. In Oracle 8.x, you can also define the same storage properties for table partitions in the Table Partition Segment Attributes Editor.

The purpose of each physical storage parameter that you can set for a table or table partition is explained below:

•	TABLESPACE. Select the tablespace in which you want the current table to be stored.

•	. Click this button to open the ORACLE Physical Object Editor and create a new tablespace.

•	CACHE. Select this check box to specify that the blocks retrieved for this table are placed at the most recently used end of the LRU list in the buffer cache when a full table scan is performed. This option is useful for small lookup tables. Clear this check box (default) to specify that the blocks retrieved for this table are placed at the least recently used end of the LRU list in the buffer cache when a full table scan is performed. This option is only available for ORACLE version 7.1 or higher.

•	PCTFREE. Enter the percentage of each block allocated to a table for future updates to the table’s data.

•	PCTUSED. Enter the minimum amount of space usage that ORACLE maintains for each block of the table.

•	INITRANS. Enter the initial number of transaction entries that are allocated within each block.

•	MAXTRANS. Enter the maximum number of transactions that can update a data block concurrently.

The purpose of each physical storage parameter that you can set for the ORACLE tablespace in this editor is explained below:

•	INITIAL. Enter the size of the initial extent in bytes.

•	NEXT. Enter the size of the next extent in bytes.

•	MINEXTENTS. Enter the minimum number of extents that can be allocated to the selected table.

•	MAXEXTENTS. Enter the maximum number of extents that can be allocated to the selected table.

•	FREELISTS. Enter the number of lists maintained by ORACLE that specify which data blocks have space available for new rows to be inserted. Increasing this parameter may improve performance if the application requires many INSERT statements to be processed concurrently.

•	FREE GROUPS. Enter the maximum number of FREELIST groups that can be allocated to a table.

•	PCTINCREASE. Enter the percent by which an extent can exceed the size of its immediate predecessor.

•	Optimal. Type the optimal size in bytes for a rollback segment. This option is available only for Oracle version 8.

•	Keep. Click this button to retain the schema object in memory to avoid I/O operations. This option is available only for Oracle version 8.

•	Recycle. Click this button to eliminate blocks from memory as soon as they are no longer needed. This option is available only for Oracle version 8.

•	Default. Click this button to ?. This option is available only for Oracle version 8.

•	PARALLEL. Enter a number that specifies the degree of parallelism for creating the table and the default degree of parallelism for queries on the table after it has been created. The degree of parallelism is the number of query servers used in the parallel operation. This option is only available for ORACLE version 7.1 or higher.

•	Logging. Click this button to specify the logging attribute of all tables, indexes, and partitions within the tablespace.

•	No Logging. Click this button to turn off the logging attribute of all tables, indexes, and partitions within the tablespace.

Related Topics

  ORACLE Physical Storage Objects

  To assign an ERwin table to a physical storage object

  To modify the storage parameters for a table

  Defining ORACLE 8.x Table Partitions

  Defining ORACLE 8.x Table Partition Segment Attributes

  Using the Table Editor


PROGRESS Table Physical Storage Properties

In the Physical Props tab of the PROGRESS Table Editor, you can set two physical storage properties to designate where the triggers that you define in ERwin will be stored in the database.

The purpose of each control in the Physical Props tab is explained below:

•	Dump File. Enter the name of the file (up to eight characters) where you want to store the contents of the selected trigger.

•	Label. Enter the label that you want PROGRESS to use in error messages.

Related Topics

  To assign an ERwin table to a physical storage object

  To modify the storage parameters for a table

  Using the Table Editor


Red Brick Table Physical Storage Properties

In the Physical Props tab of the Red Brick Table Editor, you can set the physical storage properties for a table generated by ERwin.

The purpose of each control in the Physical Props tab is explained below:

•	MAJOR. This box is checked if the current table is a Red Brick major table and unchecked if the current table is a minor table. If ERwin has incorrectly inferred that the current table is a major table, you can clear the check box to change it to a minor table. This control is available only for Red Brick versions 4.0 or earlier.

•	DATA IN. Enter the DATA IN statement for the current table, exactly as you want it to appear in the CREATE MAJOR TABLE or CREATE TABLE (for minor tables) statement.

•	PRIMARY INDEX IN. Enter the PRIMARY INDEX IN statement for the current table, exactly as you want it to appear in the CREATE MAJOR TABLE or CREATE TABLE (for minor tables) statement.

•	STAR INDEX IN. Enter the STAR INDEX IN statement for the current major table, exactly as you want it to appear in the CREATE MAJOR TABLE statement. This option appears only when the MAJOR option is checked.

•	MAXROWS. Enter a number to specify the maximum number of rows in the current table.

•	MAXSEGMENTS. Enter a number to specify the maximum number of segments in the current table. This option appears only when Red Brick 5.0 is the target server.

•	MAXROWS/SEGMENTS. Type a number to specify the maximum number of rows or segments in the current table. This option appears only when Red Brick 5.0 is the target server.

•	 Click this button to open the Red Brick Physical Objects Editor and create new physical storage objects.

Related Topics

  Red Brick Physical Storage Objects

  To assign an ERwin table to a physical storage object

  To modify the storage parameters for a table

  Using the Table Editor


SQL Server/SYBASE Table Physical Storage Properties

In the Physical Props tab of the SQL Server Table Editor and SYBASE Table Editor, you can assign a table to a segment.

The purpose of each SQL Server/SYBASE physical storage property that you can set for a table is explained below:

•	SEGMENT. Select a segment from the list provided.

•	 Click this button to open the SQL Server or SYBASE Physical Object Editor and create new segment names.

•	MAX_ROWS_PER_PAGE. Enter the maximum number of rows that you want in each segment page. This control is only available when SYBASE is the selected target server.

Note:	Although you can enter a name for a new segment and view the names of existing segments in the Physical Object Editor, you can’t actually create a segment using ERwin. To create a segment, you must use the sp_addsegment stored procedure.

Once a segment has been created, you can associate ERwin tables with it using this dialog.

Related Topics

  SQL Server/SYBASE Physical Storage Objects

  To assign an ERwin table to a physical storage object

  To modify the storage parameters for a table

  Using the Table Editor


Teradata Table Physical Storage Properties

In the Physical Props tab of the Teradata Table Editor you can enter journaling and fallback parameters for the current table. These settings are used to override any settings that you have already specified for the owning database.

The purpose of each physical storage parameter that you can set for a table is explained below:

•	WITH JOURNAL TABLE. Enter the name of the journal table used to record the journal images of the current table.

•	FALLBACK PROTECTION. Select this check box to add or remove fallback copy protection. When fallback protection is specified, original and duplicate copies of all tables are stored within the database. The duplicate copy provides a backup in case the original copy becomes corrupted, and protects the integrity of the data.

If you leave the FALLBACK PROTECTION option checked (default), the DBMS fallback protection option is used.

•	JOURNAL. Select JOURNAL, BEFORE JOURNAL, or AFTER JOURNAL from this list. Choose:

•	JOURNAL to create 0, 1, or 2 before and after images.

•	BEFORE JOURNAL to create 0, 1, or 2 before images.

•	AFTER JOURNAL to create 0, 1, or 2 after images.

If you do not select any journaling for the current table, Teradata assigns the default journaling options defined for the immediate owning database. When you choose JOURNAL, BEFORE JOURNAL, or AFTER JOURNAL, you can then select whether you want Teradata to create 0, 1, or 2 images of that journal type. Choose one of the following:

•	-- -- (dashed line) to maintain a single journal image of the specified type. This option is the default.

•	NO to maintain no journal image of the specified type.

•	DUAL to store two, mirrored journal images of the specified type.

You can maintain both a BEFORE JOURNAL and an AFTER JOURNAL for a specific table. If you choose either the BEFORE JOURNAL or AFTER JOURNAL option in the JOURNAL list, you can then set the number of images you want to maintain for the other journal type. For example, if you choose NO BEFORE JOURNAL in the top pair of JOURNAL controls, you can specify DUAL AFTER JOURNAL in the second pair.

•	FREESPACE. Enter a value to specify the percentage of free space allocated for future updates of this table.

•	DATABLOCKSIZE. Select this check box to specify the data block size in bytes or kilobytes for this table by selecting the appropriate size options.

•	MINIMUM. Click this button to specify that the minimum data block size (6144 bytes) for this table.

•	MAXIMUM. Click this button to specify that the maximum data block size (32,256 bytes) for this table.

•	SPECIFY. Click this button to specify an exact data block size. Then enter the value in the text box to the right of this control.

•	BYTE. Click this button to specify that the data block size and freespace size is calculated in bytes.

•	KILOBYTE. Click this button to specify that the data block size and freespace size is calculated in kilobytes.

Note:	If journaling is specified for a database that has fallback protection ON, dual images are maintained automatically by Teradata. If two journaling options are specified, they must not conflict. For example, you cannot select NO AFTER JOURNAL and DUAL AFTER JOURNAL for the same database.

Related Topics

  Teradata Physical Storage Objects

  To assign an ERwin table to a physical storage object

  To modify the storage parameters for a table

  Using the Table Editor


WATCOM/SQL Anywhere Table Physical Storage Properties

In the Physical Props tab of the WATCOM Table Editor and the SQL Anywhere Table Editor, you can control where ERwin tables are stored. Each table generated by ERwin can be assigned to an existing WATCOM or SQL Anywhere DBSPACE.

The purpose of each WATCOM/SQL Anywhere physical storage property that you can set for a table is explained below:

•	DBSPACE. Select the dbspace to which you want to assign this table.

•	. Click this button to open the WATCOM/SQL Anywhere Physical Object Editor and create a dbspace.

Related Topics

  WATCOM/SQL Anywhere Physical Storage Objects

  To assign an ERwin table to a physical storage object

  To modify the storage parameters for a table

  Using the Table Editor


To assign an ERwin table to a physical storage object

1.	Right-click on a table, click Table Editor on the shortcut menu, then click Physical Property.

2.	Choose the physical storage object that you want to associate with the ERwin table from the physical object list. ERwin displays the current parameter settings for the selected storage object.

3.	Click OK.

Note:	If you want to assign multiple tables to a physical storage object or modify the parameters for more than one storage object, you can select another table from the list in the editor. However, when you select a different table, ERwin immediately saves any changes made in the Table Editor. Once you select a new table, you cannot cancel changes made previously to another table. See Using the Table Editor for more information.


To modify the storage parameters for a table

1.	Right-click on a table, click <Database> Table Property on the shortcut menu, then select Physical Property.

2.	To modify any of the physical storage parameters, edit the current value.

3.	Click OK.

Note:	If you want to assign multiple tables to a physical storage object or modify the parameters for more than one storage object, you can select another table from the list in the editor. However, when you select a different table, ERwin immediately saves any changes made in the Table Editor. Once you select a new table, you cannot cancel changes made previously to another table. See Using the Table Editor for more information.


STOGROUP

A set of physical Direct Access Storage Devices (DASDs), or disk drives, on which data is stored.


Database

A reserved amount of space on one or more storage devices that is used to store data and the definitions of database objects such as tables and indexes.


Tablespace

A named partition in a database that is composed of one or more data files. After you create a tablespace, you can use it to store tables, indexes, or rollback segments.


dbspace

A reserved amount of space on one or more storage devices that is used to store tables and indexes.


Segment

A named set of one or more devices that is reserved for use by a specific SQL Server database. After you create, a segment, you can use it to store database objects such as tables and indexes.


blobspace

A dbspace that is reserved for storage of the byte and text data that makes up binary large objects, or blobs, stored in table columns.


Rollback Segment

A reserved amount of space within a tablespace that is used to store a snapshot of the data as it existed prior to processing a transaction. If the transaction fails to reach completion, all changes to the data are rolled back and the image of the data in the rollback segment is restored.


Note:

Although you can enter a name for a new physical storage object and view the names of existing physical storage objects in the Physical Object Editor, you can’t actually create these objects in ERwin. To create a physical storage object for this target server, you must use the target server’s native tools. Once a physical storage object has been created on your target server, you can use the ERwin Table Editor to associate tables with the physical storage object. See Associating ERwin Tables with Physical Storage Objects for more information.


Working With Stored Procedures

A stored procedure is a named set of precompiled SQL statements that are stored on the server, and are invoked from the client by a remote procedure call. When you create a stored procedure, you can type or paste in the SQL code for the stored procedure that is appropriate for your target server, or you can create a stored procedure using both text and ERwin template code.

You can use ERwin to reverse engineer the code for a stored procedure, or you can write the procedures in ERwin. After you complete writing stored procedures, you can attach them to individual tables or views, or you can attach them to the schema. When you generate a database schema, ERwin automatically expands any template code in the stored procedure and includes the CREATE PROCEDURE statement for each procedure that is attached to a table, view, or the schema.

Unlike the ERwin trigger support, there are no built-in stored procedure templates in ERwin because there is no standard functionality provided by a stored procedure.

ERwin provides several editors for working with stored procedures:

•	Table Stored Procedure Template Editor. Lets you create stored procedure templates that you attach to tables or views.

•	Stored Procedure Browser. Lets you view and manage individual stored procedure templates, and the tables or views that are attached to them.

•	Schema Properties Editor. Lets you attach stored procedures to the schema.

•	Schema Stored Procedure Template Editor. Lets you create stored procedure templates that you attach to the schema.

•	Stored Procedure Tab of the Table or View Editor. Lets you assign stored procedure templates to tables or views in your model.

Related Topics

  INFORMIX Stored Procedure Example

  DBMS Migration


INFORMIX Stored Procedure Example

The following example shows the stored procedure template code (top) that you might use to calculate overdue charges on an INFORMIX target server, the additional table (center) that is added to the MOVIES model to support the stored procedure, and the complete store procedure (bottom).

CREATE PROCEDURE %TemplateName_%Substr(%Tablename,1,10)
%Decl(c1,--)%Decl(c2)%Decl(v,p_)
(scannum integer, today date)

%:c1 This proc retrieves information on a customer based on the%:c2
%:c1 barcode number on their customer ID card, locates any%:c2
%:c1 outstanding movie rentals and calculates charges. Calcs%:c2
%:c1 overdue charges for the application running on the store%:c2
%:c1 cash register and inserts a record in the PMNT table%:c2
%:c1 The MOVIE RENTAL RECORD and PMNT tables are updated in the%:c2
%:c1 stored procedure to enhance security%:c2

%ForEachAtt(,";
"){DEFINE%:v%Substr(%AttFieldName,1,16)%AttDatatype};

FOREACH cursor1 FOR
  SELECT %ForEachAtt(,",
"){%AttFieldName}
    INTO %ForEachAtt(,",
"){%:v%Substr(%AttFieldName,1,16)}
    FROM%Tablename
      WHERE renting_customer=scannum;
  IF today>p_due_date THEN
      UPDATE %Tablename
      SET overdue_charge = (today - rental_date)*payment_amount
      WHERE CURRENT OF cursor1;
  END IF;
 END FOREACH;
 INSERT INTO PMNT VALUES (0,scannum,today,0);
 COMMIT WORK;
 END PROCEDURE;

CREATE PROCEDURE OVERDUE_MOVIE_RENT(scannum integer, today date)

--This proc retrieves information on a customer based on the
--barcode number on their customer ID card, locates any
--outstanding movie rentals and calculates charges. Calcs
--overdue charges for the application running on the store
--cash register and inserts a record in the PMNT table.
--The MOVIE RENTAL RECORD and PMNT tables are updated in the
--stored procedure to enhance security.

DEFINE p_renting_customer integer;
DEFINE p_master_number integer;
DEFINE p_movie_copy_number integer;
DEFINE p_rental_record_date date;
DEFINE p_rental_date date;
DEFINE p_due_date date;
DEFINE p_rental_status varchar(1);
DEFINE p_payment_amount decimal(6,2);
DEFINE p_overdue_charge decimal(6,2);

FOREACH cursor1 FOR
  SELECT renting_customer,master_number,movie_copy_number,
  rental_record_date,rental_date,due_date,rental_status,
  payment_amount,overdue_charge
    INTO p_renting_customer,p_master_number,p_movie_copy_number,
    p_rental_record_date,p_rental_date,p_due_date,p_rental_status
    p_payment_amount,p_overdue_charge
    FROM MOVIE_RENTAL_RECORD
      WHERE renting_customer = scannum;
  IF today>p_due_date THEN
      UPDATE MOVIE_RENTAL_RECORD
      SET overdue_charge = (today - rental_date)*payment_amount
      WHERE CURRENT OF cursor1;
  END IF;
 END FOREACH;
 INSERT INTO PYMT VALUES (0,scannum,today,0);
 COMMIT WORK;
 END PROCEDURE;


DBMS Migration

Although ERwin macros allow a stored procedure to be written independently from the physical data constructs, the SQL code that you use is dependent on your selected target server. Different servers support different SQL statements and syntax, so a template that is created for INFORMIX looks different from one created for SYBASE. When you migrate stored procedures from one target server to another, you have to be aware of server-specific SQL constructs, and make the changes to your stored procedure SQL code to accommodate them.

While you must change server-specific SQL code to migrate it from server to server, you do not have to update the physical table names, attribute names, and datatype information related to the stored procedure if you refer to them with macros. ERwin automatically converts table, attribute, and relationship information represented by the macros for your selected target server.

Note:	You can isolate some syntax changes or server-specific naming standards by using macro variables and assigning their value at the top of the your stored procedure. You can then change the value once and have the change appear throughout the procedure.  Use the %Decl macro to declare a variable, %=<variable> macro to assign its value, and %: to expand the variable during generation.

Related Topics

  DBMS Migration Example

  To migrate a stored procedure


DBMS Migration Example

In ERwin, the %ForEachAtt macro is used to generate variable definitions, as illustrated below:

DEFINE p_renting_customer integer;
DEFINE p_master_number integer;

If you change the target server to SYBASE, which uses a different syntax for defining variables, you must manually change the word DEFINE to DECLARE, and assign the “v” macro variable the value “@.”

DECLARE @renting_customer int
DECLARE @master_number int

The examples referenced below show the same stored procedure template code and expanded code for:

•	INFORMIX

•	SYBASE


SYBASE Stored Procedure Example

CREATE PROCEDURE %TemplateName_%Substr(%Tablename,1,10)
Decl(c1,/*)%Decl(c2,*/)%Decl(v,@)
(@scannum integer)as

%:c1 This proc retrieves information on a customer based on the%:c2
%:c1 barcode number on their customer ID card, locates any%:c2
%:c1 outstanding movie rentals and calculates charges. Calcs%:c2
%:c1 overdue charges for the application running on the store%:c2
%:c1 cash register and inserts a record in the PYMT table%:c2
%:c1 The MOVIE RENTAL RECORD and PMNT tables are updated in the%:c2
%:c1 stored procedure to enhance security%:c2

%ForEachAtt(,"%:c1%:c2
"){DECLARE%:v%Substr(%AttFieldName,1,16)%AttDatatype}
DECLARE cursor1 CURSOR FOR

 SELECT %ForEachAtt(,","){AttFieldName}
  FROM %Tablename
  WHERE renting_customer=@scannum
 open cursor1
 fetch cursor1 into %ForEachAtt(,","){%:v%Substr(%AttFieldName,1,16)}

 while (@@sqlstatus = 0)
 begin
  IF (getdate()>@due_date)
  begin
  UPDATE %Tablename
  SET overdue_charge = datediff(day,getdate(),@due_date)*payment_amount
  WHERE CURRENT OF cursor1
 end
end
 INSERT INTO PMNT VALUES (0,@scannum,getdate(),0)
 commit


INFORMIX Stored Procedure Example

CREATE PROCEDURE OVERDUE_MOVIE_RENT(@scannum integer)as

/*This proc retrieves information on a customer based on the*/
/*barcode number on their customer ID card, locates any*/
/*outstanding movie rentals and calculates charges. Calcs*/
/*overdue charges for the application running on the store*/
/*cash register and inserts a record in the PYMT table.*/
/*The MOVIE RENTAL RECORD and PMNT tables are updated in the*/
/*stored procedure to enhance security.*/

DECLARE @renting_customer int/**/
DECLARE @master_number int/**/
DECLARE @movie_copy_number int/**/
DECLARE @rental_record_date datetime/**/
DECLARE @rental_date datetime/**/
DECLARE @due_date datetime/**/
DECLARE @rental_status varchar(1)/**/
DECLARE @payment_amount decimal(6,2)/**/
DECLARE @overdue_charge decimal(6,2);
DECLARE cursor1 CURSOR FOR
  SELECT renting_customer,master_number,movie_copy_number,
  rental_record_date,rental_date,due_date,rental_status,
  payment_amount,overdue_charge
    FROM MOVIE_RENTAL_RECORD
    WHERE renting_customer = @scannum

 open cursor1
 fetch cursor1 into @renting_customer, @master_number,@movie_copy_number, @rental_record_date, @rental_date, @due_date, @rental_status, @payment_amount, @overdue_charge

 while (@@sqlstatus = 0)
 begin
  IF  (getdate()>@due_date)
  begin
  UPDATE MOVIE_RENTAL_RECORD
  SET overdue_charge = datediff(day,getdate(),@due_date)*payment_amount
  WHERE  CURRENT OF cursor1
 end
end
INSERT INTO PMNT VALUES (0,@scannum,getdate(),0)
commit


To migrate a stored procedure

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Stored Procedure on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Stored Procedure.

2.	Click the SP Template button.

3.	Select the stored procedure template you want to migrate in the SP Template Name list box.

4.	Click in the Stored Procedure Template window and use the standard editing keys to modify the SQL stored procedure to reflect the SQL syntax for your target server.

5.	Click OK.

Note:	ERwin automatically replaces macros in the stored procedure with the appropriate object names and characteristics (for example, datatype, keys, domain, and default information) for the selected target server. When you change the target server for a model, you often do not need to alter the macros to generate the correct information for the new server, just the SQL code.


Using the Table Stored Procedure Template Editor

Using the Table Stored Procedure Template Editor, you can create new stored procedure templates, and view or modify the code that is used by a particular stored procedure template. You can attach the stored procedure templates that you create to tables or views in your model.

There are two ways that you can access the Table Stored Procedure Template Editor:

•	Right-click on a table, point to Table Editor on the shortcut menu, choose Stored Procedure on the cascade menu, then click the SP Template button.

•	Right-click on a view, click View Editor on the shortcut menu, click the Stored Procedure tab, then click the SP Template button.

The purpose of each control in the Table Stored Procedure Template Editor is explained below:

•	SP Template Name. Lists the name of each stored procedure template in the active model.

•	SP Template Code. Displays the first line of the stored procedure template, which can include SQL statements and ERwin macros.

•	Attach to New Table. Select this check box to automatically attach the stored procedure template to each new table that you create. Clear this check box if you want to manually attach the stored procedure template to new tables.

•	Stored Procedure Template. Displays the template code for the selected stored procedure template, which can include SQL statements and ERwin macros.

•	New. Click this button to open the New Stored Procedure Template dialog and add a new stored procedure template.

•	Rename. Click this button to open the Rename Stored Procedure Template dialog and edit the name of the selected stored procedure template.

•	Delete. Deletes the selected stored procedure template.

•	Toolbox. Click this button to open the ERwin Template Toolbox and select an ERwin macro to add to the stored procedure template. See Using the Template Toolbox and Macros for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  Using the Table Editor

  To create a stored procedure template for a table or view

  To view the stored procedure template for a table or view

  To modify a stored procedure template for a table or view

  To delete a stored procedure template for a table or view


To create a stored procedure template for a table or view

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Stored Procedure on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Stored Procedure.

2.	Click the SP Template button.

3.	Click the New button.

4.	Type a descriptive name for the stored procedure template.

5.	Click OK.

6.	Click the Stored Procedure tab.

7.	Click in the Stored Procedure Template window and type the template code for the new stored procedure. You can use the macros in the ERwin Template Toolbox in the stored procedure template. More>

8.	Click OK to close the Table Stored Procedure Template Editor.

9.	Click OK.

Note:	Click the Attach to New Table check box before you close the editor to automatically attach the stored procedure template to each new table that you create.


To view the stored procedure template for a table or view

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Stored Procedure on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Stored Procedure.

2.	Click the SP Template button.

3.	Select the stored procedure template you want to view in the SP Template Name list box.

4.	To view additional lines of code, use the scroll bars to scroll the code in the Stored Procedure Template window.

5.	Click OK to close the Table Stored Procedure Template Editor.

6.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To modify a stored procedure template for a table or view

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Stored Procedure on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Stored Procedure.

2.	Click the SP Template button.

3.	Select the stored procedure template you want to edit in the SP Template Name list box.

4.	Choose one or more of the following options:

•	To rename a stored procedure template, click Rename, then type a new name for the stored procedure template.

•	To modify a stored procedure template, edit the text in the Stored Procedure Template window.

5.	Click OK to close the Table Stored Procedure Template Editor.

6.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To delete a stored procedure template for a table or view

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Stored Procedure on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Stored Procedure.

2.	Click the SP Template button.

3.	Select the stored procedure template you want to delete in the SP Template Name list box.

4.	Click Delete.

5.	Click OK to close the Table Stored Procedure Template Editor.

6.	Click OK.


Using the Stored Procedure Browser

Using the Stored Procedure Browser, you can see the tables and views that are attached to a stored procedure template and view the code that is used by a particular stored procedure template. You can also attach tables and views in your model to existing stored procedure templates.

There are two ways that you can access the Stored Procedure Browser:

•	Right-click on a table, point to Table Editor on the shortcut menu, choose Stored Procedure on the cascade menu, then click the SP Browser button.

•	Right-click on a view, click View Editor on the shortcut menu, click the Stored Procedure tab, then click the SP Browser button.

The purpose of each control in the Stored Procedure Browser is explained below:

•	SP Template Name. Lists the name of each stored procedure template in the active model. Select a stored procedure template from the list to view the attached tables in the Attached Table list box, or view the template code in the SP Template window.

•	SP Template Code. Displays the first line of the stored procedure template, which can include SQL statements and ERwin macros.

•	SP Template . Click this button to open the Table Stored Procedure Template Editor. See Using the Table Stored Procedure Template Editor for more information.

•	Attached Table. Lists the tables and views that are attached to the selected stored procedure template. Select a table or view from the list and click Detach to remove it from the stored procedure template.

•	<-Attach. Attaches the selected table or view to the selected stored procedure template. This button is unavailable if you have not selected a table or view in the Unattached Table list box.

•	<<-Attach All. Attaches all tables and views in the Unattached Table list box to the selected stored procedure template.

•	Detach->. Detaches the selected table or view in the Attached Table list box from the selected stored procedure template. This button is unavailable if you have not selected a table or view in the Attached Table list box.

•	Detach All->>. Detaches all tables and views in the Attached Table list box from the selected stored procedure template.

•	Unattached Table. Lists all tables and views in the active model that are not attached to the selected stored procedure template. Select a table or view from the list and click Attach to attach it to the selected stored procedure template.

•	SP Template [Read Only]. Displays the template code for the selected stored procedure template. To modify the stored procedure template, open the Table Stored Procedure Template Editor. See Using the Table Stored Procedure Template Editor for more information.

•	SP Expansion [Read Only]. Displays the expanded code for the selected stored procedure template. Expanded code is the code that will appear in the schema script when the schema is generated.

•	Close. Closes the browser and saves any changes.

Related Topics

  To view the tables and views attached to a stored procedure template

  To attach a table or view to a stored procedure template

  To detach a table or view from a stored procedure template


To view the tables and views attached to a stored procedure template

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Stored Procedure on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Stored Procedure.

2.	Click the SP Browser button.

3.	Select the stored procedure template you want to view in the SP Template Name list box. ERwin displays all tables and views that are attached to the stored procedure template in the Attached Table list box, and the expanded code for the selected stored procedure in the SP Template and SP Expansion windows.

4.	Click OK to close the Stored Procedure Browser.

5.	Click OK.


To attach a table or view to a stored procedure template

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Stored Procedure on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Stored Procedure.

2.	Click the SP Browser button.

3.	Click the name of a stored procedure template in the SP Template Name list box.

4.	Select the name of the table or view you want to attach in the Unattached Table list box.

5.	Click Attach.

6.	Click Close to close the Stored Procedure Browser.

7.	Click OK.

Hint:	Select Attach All to attach all tables and views in the Unattached Table list box to the selected stored procedure template.


To detach a table or view from a stored procedure template

1.	Choose one of the following options:

•	Right-click on a table, point to Table Editor on the shortcut menu, and choose Stored Procedure on the cascade menu.

•	Right-click on a view, click View Editor on the shortcut menu, and choose Stored Procedure.

2.	Click the SP Browser button.

3.	Click the name of a stored procedure template in the SP Template Name list box.

4.	Select the name of the table or view you want to detach in the Unattached Table list box.

5.	Click Detach.

6.	Click Close to close the Stored Procedure Browser.

7.	Click OK.

Hint:	Select Detach All to detach all tables and views in the Attached Table list box from the selected stored procedure template.


Attaching a Stored Procedure to the Schema

Using the controls in the Stored Procedure tab of the Schema Properties Editor, you can attach a stored procedure to the schema, and view the code contained in each stored procedure template.

Select <Database> Schema Property on the Server menu to open the Schema Properties Editor, then click the Stored Procedure tab.

The purpose of each control in the Stored Procedure tab is explained below.

•	Attached SP Template. Lists all stored procedure templates in the active window that are attached to the schema. ERwin generates the attached stored procedure templates when it generates the schema. Select a stored procedure template from the list to view the template code, or click Detach to move the stored procedure to the Unattached SP Template window.

•	<-Attach. Attaches the selected stored procedure template to the schema. This button is unavailable if you have not selected a stored procedure template in the Unattached SP Template list box.

•	Detach->. Detaches the selected stored procedure template from the schema. This button is unavailable if you have not selected a stored procedure template in the Attached SP Template list box.

•	Unattached SP Template. Lists all stored procedure templates in the active model  that are not attached to the schema. Unattached stored procedures do not appear in the schema script when ERwin generates the schema. Select a stored procedure template from the list to view the template code, or click Attach to attach it to the schema.

•	SP Template. Displays the template code for the selected stored procedure template, which can include SQL statements and ERwin macros.

•	SP Expansion [Read Only]. Displays the expanded code for the selected stored procedure template. Expanded code is the code that will appear in the schema script when the schema is generated.

•	Schema SP Template. Click this button to open the Schema Stored Procedure Template Editor. See Using the Schema Stored Procedure Template Editor for more information.

•	DB Sync. Click this button to start the Complete Compare task and synchronize the stored procedures defined in your data model with the information stored on the server. See Using the DB Sync Button for more information.

Related Topics

  Using the Schema Properties Editor

  To attach a stored procedure to the schema

  To detach a stored procedure from the schema


To attach a stored procedure to the schema

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Stored Procedure tab.

3.	Select the name of the stored procedure template you want to attach to the schema in the Unattached SP Template list box.

4.	Click Attach.

5.	Click OK.


To detach a stored procedure from the schema

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Stored Procedure tab.

3.	Select the name of the stored procedure template you want to detach from the schema in the Attached SP Template list box.

4.	Click Detach.

5.	Click OK.


Using the Schema Stored Procedure Template Editor

Using the Schema Stored Procedure Template Editor, you can create new stored procedure templates, and view or modify the code that is used by a particular stored procedure template.

Choose <Database> Schema Property on the Server menu to display the Schema Properties Editor. Choose the Stored Procedure tab, then click the Schema SP Template button to display the Schema Stored Procedure Template Editor.

The purpose of each control in the Schema Stored Procedure Template Editor is explained below:

•	SP Template Name. Lists all of the stored procedure templates in the active model.

•	SP Template Code. Displays the first line of the stored procedure template, which can include SQL statements and ERwin macros.

•	Stored Procedure Template. Displays the template code for the selected stored procedure template.

•	New. Click this button to open the New Stored Procedure Template dialog and add a new stored procedure template.

•	Rename. Click this button to open the Rename Stored Procedure Template dialog and edit the name of the selected stored procedure template.

•	Delete. Deletes the selected stored procedure template.

•	Toolbox. Click this button to open the ERwin Template Toolbox and select an ERwin macro to add to the stored procedure template. See Using the Template Toolbox and Macros for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To create a schema stored procedure template

  To view the schema stored procedure template code

  To modify a schema stored procedure template

  To delete a schema stored procedure template


To create a schema stored procedure template

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Stored Procedure tab.

3.	Click the Schema SP Template button.

4.	Click the New button.

5.	Type a descriptive name for the stored procedure template.

6.	Click OK.

7.	Click in the Stored Procedure Template window and type the template code.

8.	Click OK to close the Schema Stored Procedure Template Editor.

9.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To view the schema stored procedure template code

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Stored Procedure tab.

3.	Click the Schema SP Template button.

4.	Select the stored procedure template you want to view in the SP Template Name list box.

5.	To view additional lines of code, use the scroll bars to scroll the code in the Stored Procedure Template window.

6.	Click OK to close the Schema Stored Procedure Template Editor.

7.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To modify a schema stored procedure template

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Stored Procedure tab.

3.	Click the Schema SP Template button.

4.	Select the stored procedure template you want to edit in the SP Template Name list box.

5.	Choose one or more of the following options:

•	To rename a stored procedure template, click Rename, then type a new name for the stored procedure template.

•	To modify a stored procedure template, edit the text in the Stored Procedure Template window.

6.	Click OK to close the Schema Stored Procedure Template Editor.

7.	Click OK.

Hint:	To work on the template code in a larger window, click [image] to increase the window to full size. When you are finished working on the code, click [image] to return the window to normal size.


To delete a schema stored procedure template

1.	Choose <Database> Schema Property on the Server menu.

2.	Click the Stored Procedure tab.

3.	Click the Schema SP Template button.

4.	Select the stored procedure template you want to delete in the SP Template Name list box.

5.	Click Delete.

6.	Click OK to close the Schema Stored Procedure Template Editor.

7.	Click OK.


Attaching a Stored Procedure to a Table or View

You use the Stored Procedure tab of the Table Editor or View Editor to assign stored procedure templates to tables or views in your model.

The purpose of each control on the Stored Procedure tab is explained below:

•	Attached SP Template. Lists the stored procedure templates in the active model that are attached to the selected table or view. Select a stored procedure template from the list to view the template code, or click Detach to remove a stored procedure from the selected table or view.

•	<-Attach. Attaches the selected stored procedure template to the selected table or view. This button is unavailable if you have not selected a stored procedure template in the Unattached SP Template list box.

•	Detach->. Detaches the selected stored procedure template from the selected table or view. This button is unavailable if you have not selected a stored procedure template in the Attached SP Template list box.

•	Unattached SP Template. Lists the stored procedure templates that are not attached to the selected table or view. Select a stored procedure template from the list to view the template code, or click Attach to attach a stored procedure to the selected table or view.

•	SP Template. Displays the template code for the selected stored procedure template, which can include SQL statements and ERwin macros.

•	SP Expansion [Read Only]. Displays the expanded code for the selected stored procedure template. Expanded code is the code that will appear in the schema script when the schema is generated.

•	SP Browser. Click this button to open the Stored Procedure Browser. See Using the Stored Procedure Browser for more information.

•	SP Template. Click this button to open the Table Stored Procedure Template Editor. See Using the Table Stored Procedure Template Editor for more information.

Related Topics

  Using the Table Editor

  Using the View Editor

  To attach a stored procedure to a table or view

  To detach a stored procedure from a table or view


To attach a stored procedure to a table or view

1.	Choose one of the following options:

•	To attach a stored procedure to a table, right-click on the table, then click Table Editor on the shortcut menu.

•	To attach a stored procedure to a view, right-click on the view, then click View Editor on the shortcut menu.

2.	Click the Stored Procedure tab.

3.	Click the name of the stored procedure template that you want to attach to the table or view in the Unattached SP Templates list box.

4.	Click Attach.

5.	Click OK.


To detach a stored procedure from a table or view

1.	Choose one of the following options:

•	To attach a stored procedure to a table, right-click on the table, then click Table Editor on the shortcut menu.

•	To attach a stored procedure to a view, right-click on the view, then click View Editor on the shortcut menu.

2.	Click the Stored Procedure tab.

3.	Click the name of the stored procedure template that you want to remove from the table or view in the Attached SP Templates list box.

4.	Click Detach.

5.	Click OK.


Working with Subject Areas

A subject area is a subset of objects taken from the whole pool of objects in your diagram. You can create multiple subject areas in your diagram. Typically, you create a subject area to help you manage a large diagram, to reduce the number of objects that you work with, or to focus on a particular business function. Working with subject areas is especially useful when designing and maintaining a large or complex data model. Dividing the Main Subject Area into several smaller subject areas allows different groups within an organization to concentrate on the processes and tasks pertinent to their business area.

You create a subject area in the Subject Area Editor which includes options for selecting the members of a subject area. In the Subject Area Editor, you name the subject area, set global options, and select members (objects) to include in the logical model or the physical model, or both. In addition, you can use the ERwin Neighborhood feature to specify how many generations of ancestors or descendants, or both of the members you select to include in a subject area.

By default, a new data model includes one subject area (Main Subject Area) and one stored display (Display 1). For each subject area you create, ERwin adds its name to the Subject Area list on the ERwin toolbar. You can switch to a different subject area by selecting the area from the list. If you have multiple subject areas in your diagram, you can create a unique set of stored displays for each subject area. When you switch to a different subject area, you only see the stored display tabs for the current subject area. See Working with Stored Displays for more information.

When you create a subject area for a logical model, ERwin automatically creates a similar subject area for the physical model and vice-versa. If you add or remove members from a subject area, the membership change is reflected in the corresponding physical or logical model but will not affect the membership of any other subject area. However, if you add or delete objects in a subject area, such as entities and attributes, those objects are added to all other subject areas and stored displays in the diagram.

Some ERwin display options apply to all the subject areas in the diagram. For example, if you change the background color or the color of a particular object, the new color applies to every subject area and stored displays. Similarly, if you set the width or height of entities, tables, or views to a specific value, the height and width change in every subject area and stored display. See Enhancing the Appearance of an ERwin Diagram for more information.

When you save a diagram to an .er1 file, the subject areas are saved with the diagram, not as individual files. When you open an ERwin diagram, all previously created subject areas are available. See Saving an ERwin Diagram for more information.

Related Topics

  Using Subject Areas to Manage Large Diagrams

  Using the Subject Area Editor

  Letting ERwin Lay Out a Subject Area

  Saving a Subject Area

  Switching from One Subject Area to Another


Using Subject Areas to Manage Large Diagrams

The Main Subject Area includes all the objects (entities or tables/views and text blocks) in a data model. ERwin lets you divide the Main Subject Area into one or more specialized subject areas that show specific business functions or tasks. Typically, objects in a specialized subject area relate to a specific business unit such as finance, marketing, or manufacturing.

For example, the Main Subject Area in the logical MOVIES model includes entities and relationships for all facets of the business. There are two other subject areas called, Movie Inventory and Accounting, which include only those objects that relate to those aspects of the video store business. The table below shows the objects in all three subject areas.

Main Subject Area	Movie Inventory Subject Area	Accounting Subject Area
MOVIE MOVIE-COPY MOVIE-RENTAL-RECORD CUSTOMER EMPLOYEE STORE PAYMENT CHECK CREDIT CARD	MOVIE MOVIE-COPY STORE MOVIE-RENTAL-RECORD	PAYMENT CHECK CREDIT CARD
Working with subject areas is especially useful when designing and maintaining a large or complex data model. Dividing the Main Subject Area into several smaller subject areas allows different groups within an organization to concentrate on the processes and tasks pertinent to their business area.


Using the Subject Area Editor

Using the Subject Area Editor, you can create, modify, and delete subject areas in the active ERwin diagram.

When you click the [image] button on the ERwin toolbar or choose Subject Area on the Edit menu, ERwin displays the Subject Area Editor.

The purpose of each control in the Subject Area Editor is explained below:

•	Subject Area. Displays a list of all the subject areas in the active ERwin diagram. You can select the subject area you want to edit.

•	New. Click this button to open the New Subject Area dialog and add a new subject area to the active ERwin diagram.

•	Rename. Click this button to open the Rename Subject Area dialog and edit the name of the selected subject area.

•	Delete. Deletes the selected subject area from the active ERwin diagram.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The Subject Area Editor includes the following tabs:

•	General. Use this tab to identify the author of the selected subject area and exclude references to tables in the Main Subject Area that are not in the currently selected subject area during schema generation.

•	Members. Use this tab to select the objects (entities or tables/views) you want in the selected subject area.

•	Text Blocks. Use this tab to select the text blocks you want in the selected subject area.

•	Definition. Use this tab to type or edit a definition for the selected subject area.

•	UDP. Specify a user-defined property value for the subject area.

Related Topics

  To create a new subject area

  To modify a subject area

  To delete a subject area

  To switch from one subject area to another


To create a new subject area

1.	Click the [image] button on the ERwin toolbar or choose Subject Area on the Edit menu.

2.	Select the subject area that you want to use as the source for the new subject area.

3.	Click the New button.

4.	Type the name of the new subject area in the New dialog and click OK.

5.	Click the following tabs to specify the properties of the new subject area:

•	Click the General tab to specify the author’s name. In this tab, you can also exclude references to tables in the Main Subject Area that are not in the currently selected subject area during schema generation. More>>

•	Click the Members tab to specify the objects (entities or tables/views) in the subject area. More>>

•	Click the Text Blocks tab to specify the text blocks in the subject area. More>>

•	Click the Definition tab to type text that describes the function of the subject area. More>>

•	Click the UDP tab to assign user-defined properties to the subject area. More>>

6.	Click OK. ERwin returns to the diagram window showing the new subject area.

Note:	To save time or to create a new subject area that is similar to an existing one, you may want to select a subject area other than the Main Subject Area to use as the source for the new subject area .


To modify a subject area

1.	Click the [image] button on the ERwin toolbar or choose Subject Area on the Edit menu.

2.	Select the subject area that you want to modify in the Subject Area list.

3.	Click the Rename button if you want to rename the selected subject area. Edit the subject area name in the Rename Subject Area dialog, then click OK to continue.

4.	Click the following tabs to modify the properties of the selected subject area:

•	Click the General tab to modify the author’s name or change the setting that includes or excludes references to tables in the Main Subject Area that are not in the currently selected subject area during schema generation. More>>

•	Click the Members tab to add or remove objects (entities or tables/views) from the selected subject area. More>>

•	Click the Text Blocks tab to add or remove text blocks from the selected subject area. More>>

•	Click the Definition tab to type or edit text that describes the function of the subject area. More>>

•	Click the UDP tab to assign user-defined properties to the subject area or edit them. More>>

5.	Click OK.

Note:	You cannot add or delete remove (entities, tables/views, or text blocks) from the Main Subject Area in the Subject Area Editor.


To delete a subject area

1.	Choose Subject Area on the Edit menu.

2.	Select the subject area that you want to delete in the Subject Area list.

3.	Click the Delete button.

4.	Click OK.

Note:	If you delete a subject area, the objects (entities or tables/views and text blocks) in the Main Subject Area and all other subject areas are not deleted.


Identifying the Author of a Subject Area

During schema generation, you can use the controls in the General tab to identify the author of a selected subject area and exclude references to tables in the Main Subject Area that are not in the currently selected subject area.

The purpose of each control in the General tab is explained below:

•	Author. Type the name of the person that created the subject area.

•	Filtering Dangling Relationships From Schema Gen. Check this box to exclude references to tables in the Main Subject Area that are not in the currently selected subject area during schema generation. This box is unavailable (dimmed) if the currently selected subject area is the Main Subject Area. See Filtering Dangling Relationships When Generating a Schema for more information.

Related Topics

  To identify the author of a subject area


To identify the author of a subject area

1.	Choose Subject Area on the Edit menu.

2.	Select the subject area you want in the Subject Area list.

3.	Click the General tab.

4.	Type the name of the subject area author in the Author box.

5.	Click OK.


Selecting the Members of a Subject Area

You can use the controls in the Members tab of the Subject Area Editor to identify the entities, tables, or views in a subject area. The tab contains a filter control that you can use to focus on either the logical model or the physical model when specifying subject area members.

The purpose of each control in the Display Names group box is explained below:

•	Logical. Click this button to display logical model components, that is, entities in the Available and Included lists.

•	Physical. Click this button to display physical model components, that is, tables or views in the Available and Included lists.

The purpose of all other controls on the Members tab is explained below:

•	Available (Entities or Tables/Views). Displays the objects that can be members of the selected subject area. Double-click on an object to move it from the Available list to the Included list. When the Logical button in the Display Names group box is selected, this control displays the entities that can be members of the selected subject area. When the Physical button in the Display Names group box is selected, this control displays the tables/views that can be members of the selected subject area.

•	Included (Entities or Tables/Views). Displays the objects that are currently members of the selected subject area. Double-click on an object to move it from the Included list to the Available list. When the Logical button in the Display Names group box is selected, this control displays the entities that are currently members of the selected subject area. When the Physical button in the Display Names group box is selected, this control displays the tables/views that are currently members of the selected subject area.

•	. Moves the selected entity or table/view from the Available list to the Included list.

•	. Moves the selected entity or table/view in the Included list to the Available list.

•	. Moves all entities or tables/views from the Available list to the Included list.

•	. Moves all entities or tables/views from the Included list to the Available list.

•	. Click this button if you want to include the ancestors or descendants of an object when you include an object in a subject area.

•	. Click this button if you want to remove the ancestors or descendants of an object when you remove an object from a subject area.

Related Topics

  Including Ancestors or Descendants in a Subject Area Automatically

  To select the members of a subject area


Including Ancestors or Descendants in a Subject Area Automatically

You can use the [image] and [image] buttons in the Members tab of the Subject Area Editor to automatically include or exclude an object’s ancestors (for example, parents) or descendants (for example, children) when you add an object to, or remove an object from a subject area. When you click one of these buttons, ERwin opens the Spanning Neighborhood dialog, and you can specify the level of ancestors and descendants you want to include for each object in the subject area. This feature is very useful when creating subject areas in large diagrams because typically each subject area includes related objects.

The purpose of each control in the Ancestors group box is explained below:

•	All. Click this button to include all objects (entities or tables/views) that are ancestors of the selected object in the subject area.

•	Level. Click this button and type the number of ancestors that you want to include in a subject area when you include an object in a subject area. For example, if you type 2, when you include an entity in a subject area, ERwin automatically includes not only the parent entities (level 1), but also the parents of each parent entity.

The purpose of each control in the Descendants group box is explained below:

•	All. Click this button to include all objects (entities or tables/views) that are descendants of the selected object in the subject area.

•	Level. Click this button and type the number of descendants that you want to include in a subject area when you include an object in a subject area. For example, if you type the number 2, when you include an object in a subject area, ERwin automatically includes not only the children of that entity (level 1) but also the children of each child entity.

The purpose of the other controls on the Spanning Neighborhood dialog is explained below:

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To select the members of a subject area


To select the members of a subject area

1.	Choose Subject Area on the Edit menu.

2.	Select the subject area you want in the Subject Area list.

3.	Click on the Members tab.

4.	Click on one of the following buttons in the Display Names group box:

•	Logical. Click on this button to display entities in the list boxes.

•	Physical. Click on this button to display tables and views in the list boxes.

5.	Select the objects you want to include in the subject area using any combination of the methods described below:

•	Select an object in either list, then click the [image] or [image] button to move the object from the Available list to the Included list or vice-versa.

•	Click the [image] or [image] button to move all objects from the Available list to the Included list or vice-versa.

•	Click the [image] or [image] button to open the Spanning Neighborhood dialog. In the Ancestors group box, click the All button or click the Level button and type the number of ancestors you want to include. In the Descendants group box, click the All button or click the Level button and type a number representing the level of descendants you want to include. Click OK to return to the Subject Area Editor dialog. Use the buttons to select the objects you want to include in the subject area. The level of ancestors and descendants you specified are also automatically included in the subject area.

6.	Click OK or select another tab when the Included (Entities or Tables/Views) list contains the objects you want in the selected subject area.

Note:	You can also use SHIFT+click to select consecutive objects or CTRL+click to select non-consecutive objects in both lists.


Including Text Blocks in a Subject Area

You can use the controls in the Text Blocks tab of the Subject Area Editor to identify the text blocks that you want to include in the selected subject area.

The purpose of each control on the Text Blocks tab is explained below:

•	Available Text. Displays the text blocks that can be members of the selected subject area. Double-click on a text block to move it from the Available Text Block list to the Included Text Block list.

•	Included Text Blocks. Displays the text blocks that are currently members of the selected subject area. Double-click on a text block to move it from the Included Text Block list to the Available Text Block list.

•	. Moves the selected text block from the Available Text list to the Included Text Blocks list.

•	. Moves the selected text block from the Included Text Blocks list to the Available Text list.

•	. Moves all text blocks from the Available Text list to the Included Text Blocks list.

•	. Moves all text blocks from the Included Text Blocks list to the Available Text list.

Note:	If you cannot see the full text of the text block in the list, you can use the ERwin Name Tips feature. Simply, move the cursor over the text block that you want to see, wait a moment, and the full text is displayed in a Name Tip box.

Related Topics

  To include text blocks in a subject area


To include text blocks in a subject area

1.	Choose Subject Area on the Edit menu.

2.	Select the subject area you want in the Subject Area list.

3.	Click on the Text Blocks tab.

4.	Select the text blocks you want to include in the subject area using any combination of the methods described below:

•	Select a text block in either list, then click the [image] or [image] button to move the text block from the Available Text Blocks list to the Included Text Blocks list or vice-versa.

•	Click the [image] or [image] button to move all text blocks from the Available Text Blocks list to the Included Text Blocks list or vice-versa.

5.	Click OK or click on another tab when the Included Text Blocks list contains the text blocks that you want in the subject area.


Entering or Editing a Definition for a Subject Area

You can use the controls in the Definition tab of the Subject Area Editor to type or edit a definition for the selected subject area.

The purpose of each control on the Definition tab is explained below:

•	Definition. Type or edit the definition text for the selected subject area.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  To enter or edit a definition for a subject area


To enter or edit a definition for a subject area

1.	Choose Subject Area on the Edit menu.

2.	Select the subject area you want in the Subject Area list.

3.	Click on the Definition tab.

4.	Type or edit the text in the Definition text box.

5.	Click OK.

Note:	You can use the cut, copy, and paste tools at the top of the Definition text box to cut, copy, and paste text to or from the Clipboard.


Specifying subject area UDP Values

After you create UDPs for a subject area in the UDP Editor, you can easily specify property values for the subject area in the UDP tab of the Subject Area Editor.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP for which you can select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor.

Related Topics

  Using the Subject Area Editor

  To specify subject area UDP values

  Creating User-Defined Properties


To specify subject area UDP values

1.	Define a subject area property. More>>

2.	Select Subject Area on the Edit menu.

3.	Click the UDP tab.

4.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

5.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

6.	Click OK.


Saving a Subject Area

ERwin saves all subject areas along with the Main Subject Area diagram when you save the diagram as an .er1 file. You cannot save a subject area as an individual file. For example, when you save the diagram, if you create a subject area in the MOVIES diagram, the associated subject area is saved with the file.

If you create a new subject area or make changes to an existing subject area in the Subject Area Editor, ERwin saves those changes when you click OK to close the editor. However, you must choose Save or Save As on the File menu to permanently save all the subject area information with the file.


Letting ERwin Lay Out a Subject Area

When you create a new subject area, ERwin automatically places the subject area members and their relationships in the same relative place in which they appeared in the original subject area. Because the new subject area has fewer objects, you may want to optimize the space in the diagram.

You can use the automatic layout feature to place the objects in the new subject area close together. To let ERwin automatically layout the objects in a subject area, choose Layout on the Option menu. See Letting ERwin Lay Out Your Diagram  for more information.

Related Topics

  To let ERwin lay out a subject area


To let ERwin lay out a subject area

1.	Select Layout on the Option menu.

2.	Click the Layout button. ERwin informs you that the automatic layout is irreversible and gives you the option to cancel the request.

3.	Click Yes.


Switching from One Subject Area to Another

If you create several subject areas from one data model, you can switch from one subject area to another by selecting the subject area you want from the subject areas list on the ERwin toolbar.

Related Topics:

  To switch from one subject area to another


To switch from one subject area to another

•	Click on the down arrow of the subject areas list [image] on the ERwin toolbar, then select the subject area you want to display.


Working with Views

A view is a SQL query that is permanently stored in the database under an assigned name. The result of the view query is a virtual table. To the database user, a view appears just like a real table with a set of named columns and rows of data. Unlike a table however, a view is not a permanently stored set of data values. Instead, the rows and columns of data visible through the view are the results of the database query that defines the view. Views are an important part of SQL for several reasons:

•	Views let you create your own customized presentation of the data stored in a database.

•	Views let you restrict access to data, allowing different users access to only certain rows or columns of a table.

•	Views simplify database access by letting you create customized structures tailored to the needs of individual users. A user can write a simple query on a view rather than a complex query on the actual database tables.

Using ERwin, you can create views in your data model. When you forward-engineer your data model to generate a database, ERwin automatically generates the SQL code defining the view and stores it in the database. When you reverse-engineer an existing database that includes one or more views, ERwin imports each view, parses the view syntax and where possible creates view relationships to the tables referenced by the view.

Views are supported by ERwin’s complete compare feature so that when you update a view either in your data model or in your database, you can easily keep your data model view specification in sync with your database view specification.

Related Topics

  View Representation in ERwin

  Creating a View

  Using the View Editor

  Using the View Column Editor

  Using the View Relationship Editor


How ERwin Represents Views

In ERwin, views are displayed in the physical model only. ERwin represents a view as a box with a dotted outline and round corners, and a view relationship as a dotted line with circle at the view end of the line. A view relationship between a table (or view) and a view indicates that the view references one or more of the columns from that table (or view).

A view column can be a reference to a table column, a reference to a column in different view, or a user-defined expression.

•	For view columns that are references to table (or view) columns, the naming convention is as follows:
<ViewColumnName>: <SourceTableName>.<SourceColumnName>

•	For view columns that are user-defined expressions, the naming convention is as follows:
< ViewColumnName >: <expression>

When you draw a view relationship between a table and a view, all of the columns in that table automatically migrate to the view. By default, the <ViewColumnName> is the same as the <SourceColumnName> until you edit the view column name.

You can edit views directly in your diagram using on-diagram editing. When you drag a column from a table into a view, ERwin automatically creates the view column and the view relationship. You can drag a view column out of a view to remove it from the view.

If you delete a table column that is referenced by a view, ERwin automatically deletes the corresponding view column. If you delete a table that is referenced by a view, ERwin automatically deletes the corresponding view columns.

ERwin provides three editors for creating and managing database views:

•	View Editor. Right-click on a view, then click View Editor on the shortcut menu. In this editor, you can change the properties of a view.

•	View Column Editor. Right-click on a view, then click View Column Editor on the shortcut menu. In this editor, you can change the properties of the view columns.

•	View Relationship Editor. Right-click on a view relationship, then click View Relationship Editor on the shortcut menu. In this editor, you can change the properties of a view relationship.


Creating a View

In the physical model, the ERwin toolbox contains the View and View Relationship tools. To create a view, click on the View tool in the ERwin Toolbox, then click in the diagram where you want the view. ERwin displays a view symbol in the diagram. By default, the view is named V_n, where V stands for view, and n is a unique number.

Related Topics

  To create a view


To create a view

1.	Click [image] in the ERwin toolbox.

2.	Click in the diagram at the position you want to insert the view.

3.	Type a name for the view.

4.	Click [image] in the ERwin toolbox.

5.	Click on the table you want to use as the source table for a view.

6.	Click on the view symbol you just created. ERwin creates a view relationship between the source table and the view. By default, the view references all columns in the source table.

7.	Click [image] in the ERwin toolbox.

8.	Drag unwanted view columns into free space on the diagram to delete them from the view.

Note:	You can drag one or more columns from a table into a view. ERwin automatically creates the view column references and the associated view relationship.

Related Topics

  Using the View Editor


Using the View Editor

You can use the View Editor to specify the properties of a view. Right-click on a view, then click View Editor on the shortcut menu to open the View Editor. You can select the view that you want to work on, change the name of the view, and enter or edit the owner name for the selected view. You can also specify whether you want ERwin to generate the view SQL code during forward engineering or synchronization.

The meaning of each control in the View Editor is as follows:

•	View. Displays the currently selected view. You can select a different view from the list provided.

•	Name. Edit the name of the view.

•	Owner. Enter or edit the database owner name you want to associate with the view.

•	Generate. Select this check box to include the view in the schema that ERwin generates.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The View Editor also displays a number of controls on tabs. When you click on the tab, ERwin displays a set of controls of the specified type. For example, in the View Editor, you can display the view comment on the Comment tab.

Often, ERwin displays only the first few tabs that are available. You can scroll through the available tabs using the spin control [image] to locate the tab you want. The View Editor includes the following tabs:

♦	Select. Use this tab to select the source table columns for a view.

♦	From. Use this tab to select the source tables for a view.

♦	Where. Use this tab to specify constraints for a view.

♦	SQL. Use this tab to edit the SQL code for a view.

♦	Comment. Use this tab to enter or edit a comment for a view.

♦	Stored Procedure. Use this tab to attach a stored procedure to a view.

♦	Pre and Post Script.Use this tab to attach a pre- or post-script to a view.

♦	PowerBuilder.Use this tab to assign PowerBuilder properties to a view.


Specifying View Columns Using the View Editor

You use the Select tab of the View Editor to specify the view columns. You can create view column references to any table column or view column in your diagram. By default, the view column name reflects the column name that the view references, but you can change a view column name. You can also put the view columns in the order you want.

In addition to specifying references to existing columns, you can create and manage view expressions. A view expression is a user-defined expression that is stored as a view column.

The purpose of each control in the Select tab is explained below:

•	Available Table/View Columns. Displays the names of the tables or views and associated columns that can be referenced by the selected view. Double-click on a column to move it to the View Column list and include it in the selected view. You can double-click on a table or view to move all of the columns in that table or view to the View Column list, or you can use the arrow buttons described below. You can add or remove tables or views in the  Available Table/View Columns using the controls in the From tab.

•	. Moves the selected column or all columns in the selected table or view from the Available Table/View Columns list to the View Columns list.

•	. Moves the selected column in the View Columns list to the Available Table/View Columns list.

•	. Moves all columns from the Available Table/View Columns list to the View Columns list.

•	. Moves all columns from the View Columns list to the Available Table/View Columns list.

•	View Columns. Shows the view columns currently in the view. Click on a column to select it.

•	. Moves the selected column up one position in the list of view columns. This button is grayed if the selected column is at the top of the list.

•	. Moves the selected column down one position in the list of view columns. This button is grayed if the selected column is at the bottom of the list.

•	DISTINCT. Select this check box to specify a view that automatically eliminates duplicate rows.

•	New Expression. Click this button to open the New View Column Expression dialog and enter a user-defined expression as a view column.

•	Name. Edit the name of the selected view column.

•	Expr. Edit the selected view column expression. This box is only enabled if the selected view column is a user-defined expression.

Related Topics

  View Editor and View Column Editor Icons

  To change the columns referenced by a view

  To change the order of the columns referenced by a view

  To rename a view column in the View Editor

  To create a view column expression using the View Editor

  To edit a view column expression in the View Editor

  To delete a view column expression in the View Editor

  Using the View Editor


View Editor and View Column Editor Icons

The following table shows the icons are used to identify objects in the View Editor and the View Column Editor.

Icon	Object
	Independent table
	Dependent table
	Column in an independent table
	Column in a dependent table
	View
	View column
	View column expression


To change the columns referenced by a view

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Select tab.

3.	Choose one of the following options:

•	To add a column to the view, double-click on the column in the Available Table/View Columns list. ERwin moves the column to the View Columns list.

•	To remove a column from a view, double-click on the column you want to remove in the View Columns list.

4.	Click OK.


To rename a view column in the View Editor

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Select tab.

3.	Click on a column in the View Columns list.

4.	Edit the name in the Name box.

5.	Click OK.


To change the order of the columns referenced by a view

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Select tab.

3.	Click on a column in the View Columns list, then click [image] or [image] to move the column up or down relative to the other columns in the list.

4.	Repeat step 3 for other view columns until the View Columns list shows the order you want.

5.	Click OK.


To create a view column expression in the View Editor

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Select tab.

3.	Click the New Expression button to open the New View Column dialog.

4.	Type the name of the column in the Name box.

5.	Type the expression in the Expression box.

6.	Click OK. ERwin displays the new expression in the view.


To edit a view column expression in the View Editor

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Select tab.

3.	Click on the expression you want to modify in the View Columns list.

4.	Click in the Name box and edit the expression name. The expression name in the View Columns list is automatically updated when you click on another control.

5.	Click in the Expr box and edit the expression. The expression name in the View Columns list is automatically updated when you click on another control.

6.	Click OK.


To delete a view column expression in the View Editor

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Select tab.

3.	Click on the expression you want to delete in the View Columns list.

4.	Click [image]. ERwin deletes the expression from the View Columns list.

5.	Click OK.


Specifying View Columns Using On-Diagram Editing

You can use ERwin's on-diagram editing features to add columns to a view. You can:

•	Drag a table column into a view.

•	Create a view relationship between a table and a view.

•	Remove unwanted column references from a view.

•	Change a view name.

•	Change a view column name.

•	Change a view column expression.

Related Topics

  To drag a table column into a view

  To create a view relationship

  To remove an unwanted column from a view

  To change a view name using on-diagram editing

  To change a view column name using on-diagram editing

  To change a view column expression name using on-diagram editing

  Using the View Editor


To drag a table column into a view

1.	Click [image] in the ERwin toolbox. The cursor changes to the hand shape.

2.	Drag the table column that you want to include from the source table into the view. ERwin creates the view column and adds a view relationship between the table and the view if one did not previously exist.


To create a view relationship

1.	Click [image] in the ERwin toolbox. The cursor changes to the view relationship symbol.

2.	Click on the table that you want to be the source table for the view, then click on the view. ERwin creates the view relationship.

Note:	By default, all table columns are added to the view through the view relationship. You can remove unwanted view columns simply by using the hand tool in the ERwin toolbox to drag them into free space in the diagram.


To remove an unwanted column from a view

1.	Click [image] in the ERwin toolbox. The cursor changes to the hand shape.

2.	Drag the view column reference that you want to remove out of the view into free space on the diagram. ERwin deletes the view column from the view.


To change a view name using on-diagram editing

1.	Click [image] in the ERwin Toolbox if not already selected.

2.	Click on the view you want to rename, wait a moment, then click on the view again. ERwin displays a text cusor in the view name.

3.	Use the standard keyboard editing keys to edit the view name.

4.	Click on free space in the diagram.


To change a view column name using on-diagram editing

1.	Click [image] in the ERwin Toolbox if not already selected.

2.	Click on the view column you want to rename, wait a moment, then click on the view column again. ERwin displays a text cusor in the view column name.

3.	Use the standard keyboard editing keys to edit the view column name.

4.	Click on free space in the diagram.


To change a view column expression name using on-diagram editing

1.	Click [image] in the ERwin Toolbox if not already selected.

2.	Click on the view column expression you want to rename, wait a moment, then click on the view column expression again. ERwin displays a text cusor in the view column expression name.

3.	Use the standard keyboard editing keys to edit the view column expression name.

4.	Click on free space in the diagram.


Selecting the Source Tables for a View

You use the From tab of the View Editor to specify the source tables (or views) for a view, that is, the tables (or views) that are referenced by the view. You can also specify the order of the tables (or views) and for each source table (or view), you can specify an alias name, that is, a name more meaningful within the context of the view.

The purpose of each control in the From tab is explained below:

•	Available Tables/Views. Displays the names of all the tables and views in the active diagram. You can double-click on a table or view in this list to move it to include its columns in the selected view. When you double-click on the table or view name, ERwin moves it to the From list.

•	From. Displays the names of all the source tables for the selected view in the specified order. You can double-click a table or view name in this list to remove the columns from the selected view and move the table name to the Available Tables/Views list.

•	. Moves the selected source table up one position in the list of source tables. This button is dimmed if the selected table is at the top of the list.

•	. Moves the selected source table down one position in the list of source tables. This button is dimmed if the selected table is at the bottom of the list.

•	. Copies the selected table or view in the Available Tables/Views list to the From list and adds the associated columns to the view.

•	. Removes the selected table or view from the From list and removes the associated columns from the view.

•	Alias. Enter an alternative name for the selected source table. Typically, an alias is a new name that is more appropriate in the context of the view. This control is dimmed if you do not select a table or view selected in the From list.

Related Topics

  View Editor and View Column Editor Icons

  To select the source tables for a view

  To specify an alias for a view source table

  Using the View Editor


To select the source tables for a view

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the From tab of the View Editor.

3.	Choose one of the following options:

•	To include the selected table in the From list, double-click on a table (or view) in the Available Table/Views.

•	To removed the selected table from the From list, click on a table (or view) in the From list.

4.	Click on a table (or view) in the From list, then click [image] or [image] to move the table (or view) up or down one position relative to the other tables/views in the list. Repeat this step for this and other tables/views until the From list shows the order you want.

5.	Click OK.


To specify an alias for a view source table

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the From tab in the View Editor.

3.	Click on a table (or view) in the From list.

4.	Enter the name you want to use as an alias for the selected table in the Alias box.

5.	Click OK.


Specifying View Constraints

You use the Where tab of the View Editor to specify view characteristics.

The purpose of each control in the Where tab is explained below:

•	Where. Enter the search condition that must be satisfied by the results of the view query. The text you enter becomes the WHERE clause in the SQL code that ERwin generates for the selected view.

•	Group By. Enter the criteria that you want to use to group rows returned by the view query. The text you enter becomes the GROUP BY clause in the SQL code that ERwin generates for the selected view.

•	Having. Enter the search condition that is applied to each row group and filters out rows that do not meet the specified search condition. The text you enter becomes the HAVING clause in the SQL code that ERwin generates for the selected view. This option is only available if the currently selected target server supports the HAVING clause.

•	Order By. Enter the criteria on which you want to sort the rows returned by the view. The text you enter becomes the ORDER BY clause in the SQL code that ERwin generates for the selected view. This option is only available if the currently selected target server supports the ORDER BY clause.

•	WITH CHECK OPTION or WITH. Select this check box to specify that you want the DBMS to check that a row satisfies the search condition in the WHERE clause before it inserts or updates rows in the source tables. If you check this option, the WITH CHECK OPTION or WITH syntax is added to the SQL code that ERwin generates for the selected view. The options are as follows:

•	CASCADED. Click this button to specify that the DBMS checks that the selected view satisfies the constraints of all views on which it is dependent before performing an insert or update operation on the selected view. This option is available to AS/400 and DB2/2 servers only.

•	LOCAL. Click this button to specify that the DBMS checks that a dependent view (that is, a view that is dependent on the selected view) satisfies the constraint of the selected view before performing an insert or update operation on a dependent view. This option is available to AS/400 and DB2/2 servers only.

•	READ ONLY. Click this button to specify that the view is read only, that is, you cannot insert rows into the view or update values in the existing rows. This option is available to Oracle servers only.

•	CHECK OPTION. Click this button to speicfy that any INSERT or UPDATE operation on the view is checked to make sure that the resulting rows meet the search criteria (WHERE clause) defined in the view. This option is available to Oracle servers only.

•	CONSTRAINT. Enter a constraint that the view must satisfy. This option is available to Oracle and Rdb servers only.

Related Topics

  To specify a search condition for a view

  To specify a grouped view

  To specify a WITH CHECK OPTION for a view

  To specify a view with sorted rows

  Using the View Editor


To specify a search condition for a view

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Where tab.

3.	Enter the condition that you want view rows to satisfy in the Where (row restriction) box.

4.	Click OK.

Note: In step 3, you do not have to type the WHERE keyword.


To specify a view with a GROUPED BY clause

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Where tab.

3.	Enter the criteria on which you want to group view rows in the Group By box.

4.	Optionally, enter a search condition in the Having box that is applied to each row group and filters out row groups that do not match the search condition from the query results.

5.	Click OK.


To specify a WITH CHECK OPTION for a view

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Where tab.

3.	Select the WITH CHECK OPTION or WITH check box.

4.	For an AS/400 or DB2/2 server, choose one of the following options:

•	CASCADED. Click this button to make the DBMS check that the selected view satisfies the constraints of all views on which it is dependent before performing an insert or update operation on the selected view.

•	LOCAL. Click this button to make the DBMS check that a dependent view (that is, a view that is dependent on the selected view) satisfies the constraint of the selected view before performing an insert or update operation on a dependent view.

5.	For an Oracle server, choose one of the following options:

•	READ ONLY. Click this button to specify that rows cannot be inserted or values in existing rows changed in the view.

•	CHECK OPTION. Click this button to indicate that a row must satisfy the constraint you enter in the CONSTRAINT box before the row is inserted in the view or the view is updated.

6.	For an RdB server, enter a constraint that a row must satisfy in the CONSTRAINT box before the row is inserted in the view or the view is updated.

7.	Click OK.


To specify a view with sorted rows

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Where tab.

3.	For, all supported versions of Access and Rdb, and Teradata version 2.0, click in the Order By box and enter the criteria on which you want the rows of the selected view sorted.

4.	Click OK.


Editing the SQL Code for a View

You use the SQL tab of the View Editor to view the SQL code that ERwin maintains for the selected view. You can select the User-Defined SQL option to enable customization of the SQL code, but be aware that once you choose this option, ERwin no longer maintains any view relationships to source tables in the model. When you select the User-Defined SQL option, any changes you make in the Select, From, and Where tabs are not reflected in the SQL code. ERwin maintains a user-defined SQL view as a block of code and not as an integrated model component.

The purpose of each control in SQL tab is explained below:

•	View. Displays the SQL code for the selected view. You can edit the code in this box if you select the User-Defined SQL check box.

•	User-Defined SQL. Select this check box to enable editing of the SQL code in the View box. Select this check box only if you want the view to contain syntax that ERwin cannot represent, for example, a UNION statement. When you select this check box, ERwin no longer maintains references to the base tables and columns to which the view refers.

Related Topics

  To edit the SQL code for a view

  Using the View Editor


To edit the SQL code for a view

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the SQL tab.

3.	Select the User-Defined SQL check box.

4.	Edit the SQL code in the View box.

5.	Click OK.

Note:	When you select the User-Defined SQL option, ERwin no longer maintains any view relationships to source tables in the model.


Entering or Editing a Comment for a View

You use the Comment tab of the View Editor to maintain a comment that describes the function or purpose of the selected view.

The purpose of each control in the Comment tab is explained below:

•	View Comment. Enter or edit the comment associated with the selected view.

•	. Cuts, copies, and pastes text using the Windows clipboard.

•	. Opens the ERwin Text Editor.

Note:	If your database supports comments for views, you can generate these comments in the schema. Otherwise, comments are for information only.

Related Topics

  To enter or edit a comment for a view

  Using the View Editor


To enter or edit a comment for a view

1.	Right-click on a view, then click View Editor on the shortcut menu.

2.	Click on the Comment tab.

3.	Enter or edit the text in the Comment box.

4.	Click OK.


Using the View Column Editor

You can use the View Column Editor to specify the properties of a view column. You can create a new view column expression and rename or delete an existing view column. To open the View Column Editor, right-click on a view, then click View Column Editor on the shortcut menu.

The purpose of the controls in this editor are as follows:

•	View. Displays the currently selected view. Select a different view from the list provided.

•	 (View). Click this button to open the View Editor and enter or edit view properties.

•	Column. Displays the columns in the selected view.

•	. Moves the selected column up one position in the Column list.

•	. Moves the selected column down one position in the Column list.

•	New. Click this button to open the New View Column dialog and add a view column expression to the view.

•	Rename. Click this button to open the Rename dialog and change the view column name.

•	Delete. Deletes the selected view column from the view.

•	Reset. Click this button to open the Reset Column Properties dialog and reset one or more properties of the selected column to the default setting specified by the associated domain. See Resetting Column Properties to the Domain Defaults for more information.

•	DB Sync. Click this button to open the Complete Compare - Set Options dialog and synchronize column information in your data model with the information stored in the corresponding database. See Using the DB Sync Button for more information.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The View Column Editor also displays a number of controls on tabs. When you click on the tab, ERwin displays a set of controls of the specified type. For example, in the View Column Editor, you can display the view column comment on the Comment tab.

Often, ERwin displays only the first few tabs that are available. You can scroll through the available tabs using the spin control [image] to locate the tab you want. The View Column Editor includes the following tabs:

•	General. Use this tab to assign a domain to a view column.

•	Select. Use this tab to enter or edit a view column expression.

•	AS/400 or Access. Use these tab to specify column display properties.

•	Comment. Use this tab to enter or edit a comment for a view column.

•	PowerBuilder or Visual Basic. Use these tabs to assign PowerBuilder or Visual Basic properties to a view column.

Related Topics

  View Editor and View Column Editor Icons

  To create a view column expression in the View Column Editor

  To rename a view column

  To delete a view column


To create a view column expression in the View Column Editor

1.	Right-click on a view, then click View Column Editor on the shortcut menu.

2.	Click the New button.

3.	Type the name of the view column expression in the Column box.

4.	Enter the expression text in the Expression box.

5.	Click OK.


To rename a view column

1.	Right-click on a view, then click View Column Editor on the shortcut menu.

2.	Select the view column you want to rename in the Column list.

3.	Click the Rename button.

4.	Edit the view column name in the Column box.

5.	Click OK.


To delete a view column

1.	Right-click on a view, then click View Column Editor on the shortcut menu.

2.	Click on the column you want to delete in the Column list.

3.	Click Delete.

4.	Click OK.

Hint:	You can also delete a view column by selecting the hand tool in the ERwin toolbox and dragging the view column into free space in the diagram.


Assigning a Domain to a View Column

You use the General tab of the View Column Editor to assign a domain to a view column. By default, view columns are automatically attached to a domain (named <TableName.TableColumnName> or <ViewName.ViewColumnName>) which is the set of properties of the source table column.

The purpose of each control on the General tab is as follows:

•	Domain. Shows a hierarchical list of all the domains in the current model. The highlighted domain is the domain associated with the currently selected view column in the View Column list. Click on a different domain to associate the currently selected view column with that domain.

Related Topics

  To assign a different domain to a view column

  Using the View Column Editor


To assign a different domain to a view column

1.	Right-click on a view, then click View Column Editor on the shortcut menu.

2.	Select a view column in the Column list.

3.	Click on the General tab if not already selected.

4.	Click on a domain in the Domain list to assign the domain to the selected column.

5.	Click OK.


Editing a View Column Expression

You use the Select tab of the View Column Editor to edit the selected view column expression.

The purpose of each control on the Select tab is as follows:

•	Select Expression. Displays the selected view column expression. Edit the expression text as required. This control is dimmed if the currently selected column in the Column list is not a view column expression.

•	. Cuts, copies, and pastes text using the Windows clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  To edit a view column expression in the View Column Editor

  Using the View Column Editor


To edit a view column expression in the View Column Editor

1.	Right-click on a view, then click View Column Editor on the shortcut menu.

2.	Select the view column that is defined by the expression you want to edit in the Column list.

3.	Click on the Select tab.

4.	Edit the text in the Select Expression box.

5.	Click OK.


Entering or Editing a Comment for a View Column

You use the Comment tab of the View Column Editor to enter or edit the comment associated with a view column. By default, a view column inherits the source column’s comment. This is indicated by an asterisk next to the control name. If you edit the comment, you override the default comment and the asterisk disappears.

The purpose of each control in the Comment tab is as follows:

•	Comment. Enter or edit the view column comment text in this box. If it is empty, the column inherits the comments from the source column.

•	. Cuts, copies, and pastes text using the Windows clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  To enter or edit a comment for a view column

  Using the View Column Editor


To enter or edit a comment for a view column

1.	Right-click on a view, then click View Column Editor on the shortcut menu.

2.	Click on the Comment tab.

3.	Enter or edit the comment in the Comment box.

4.	Click OK.


Using the View Relationship Editor

You can use the View Relationship Editor to specify the properties of a view relationship, also known as a view derivation. Right-click on a view relationship, then click View Relationship Editor on the shortcut menu to open the View Relationship Editor.

The purpose of each control is explained below:

•	Parent Table. Displays the name of the parent table or view in the selected view relationship.

•	Child View. Displays the name of the child view in the selected view relationship.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

You can enter an alias for each source table referenced through the selected view relationship, modify the order of the tables in the FROM clause of the view by ordering the view relationships, and enter or edit a definition for the selected view relationship using the tabs on the View Relationship Editor:

•	Properties. You use this tab to enter an alias for the source table (or view) referenced through the selected view relationship.

•	Comment.You use this tab to enter a comment for the selected view relationship.


Modifying View Relationship Properties

You use the Properties tab of the View Relationship Editor to modify the properties of a view relationship. You can enter an alias for the source table (or view) referenced through the selected view relationship. You can also specify the position of the table (or view) referenced throught the selected view relationship relative to other tables (or views) in the FROM clause of the CREATE VIEW statement. The order of the tables (or views) in the FROM clause is displayed as static text next to the FROM label. For INFORMIX servers, you can also specify if a view relationship is an outer join.

The purpose of each control in the Properties tab is explained below:

•	Alias. Enter or edit an alias name for the parent table (or view) in the selected view relationship.

•	Sequence. Select the position of the parent table (or view) that is referenced throught the selected view relationship relative to other parent tables (or views) referenced by the view. The order determines the order of the tables (or views) in the FROM clause of the view. You can also change this order in the View Editor. See Selecting the Source Tables for a View for more information.

•	From. Shows the order of the parent tables (or views) in the FROM clause of the view. You can change the sequence of the parent tables in the FROM clause using the Sequence control as described above.

•	OUTER. Select this check box to specify the view relationship is an outer join. This control is only available when INFORMIX is the selected target server.

Related Topics

  To assign an alias to the source table or view referenced through a view relationship

  To change the sequence of the tables referenced by the view

  Using the View Relationship Editor


To assign an alias to the source table or view referenced through a view relationship

1.	Right-click on the relationship between the view and the source table or view, then click View Relationship Editor on the shortcut menu.

2.	Click on the Properties tab.

3.	Enter the alias you want to assign to the source table or view in the Alias box.

4.	Click OK.


To change the sequence of the tables referenced by a view

1.	Right-click on the relationship between the view and the source table or view, then click View Relationship Editor on the shortcut menu.

2.	Click on the Properties tab.

3.	Select the position of the source table or view relative to the other source tables or views referenced by the view in the Sequence box. The read-only text below the Sequence box shows the order of the tables and views in the FROM clause of the view.

4.	Click OK.


Entering or Editing a Comment for a View Relationship

You use the Comment tab of the View Relationship Editor to enter or edit the comment associated with the selected view relationship.

The purpose of each control in the Comment tab is as follows:

•	Comment. Enter or edit a comment for the selected view relationship.

•	. Cuts, copies, and pastes text using the Windows clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  To enter or edit a comment for a view relationship

  Using the View Relationship Editor


To enter or edit a comment for a view relationship

1.	Right-click on the relationship between the view and the source table or view, then click View Relationship Editor on the shortcut menu.

2.	Click on the Comment tab.

3.	Enter the comment text in the Comment box.

4.	Click OK.


Welcome to the ERwin Workplace

The ERwin diagram window is the main window, and it includes the following elements:

•	Title Bar

•	Menu Bar

•	Toolbar

•	Font and Color Toolbar

•	Independent Attribute Browser and Independent Column Browser

•	Toolbox

•	Diagram Window

•	Stored Display Tabs

•	Status Bar

You use the components of an ERwin window to perform logical and physical modeling using either IDEF1X or IE notation. You can also use DM (Dimensional Modeling) notation to diagram a physical dimensional model.

Related Topics

  Navigating Using the Keyboard

  Using ERwin's Logical and Physical Modeling Features

  Working with IDEF1X, IE, and DM Notation


ERwin Title Bar

The ERwin title bar is located at the top of every ERwin diagram window, and it extends across the width of the window. To see a description for a section in the ERwin title bar, click on it below.


Product

Identifies the name of the product in which you are currently working, such as ERwin/ERX or ERwin/Navigator.


ERwin Diagram Name

Identifies the name of the ERwin or ModelMart diagram in which you are currently working.


Subject Area

Identifies the name of the current subject area in the current ERwin diagram.


Stored Display

Identifies the name of the current stored display in the ERwin diagram.


ERwin Menu Bar

The ERwin menu bar includes the following menus:

•	File

•	ModelMart

•	Edit

•	Tasks

•	Client

•	Server

•	Option

•	Window

•	Help

Related Topics

  Shortcut Menus


File Menu

The options on the File menu include:

•	New. Displays the ERwin Template Selection dialog to let you select a template from which a new ERwin data model is started.

•	Open. Displays the ERwin Open File dialog to let you select an existing data model.

•	Close. Displays the Close Diagram dialog to let you save changes that you have made in your diagram.

•	Save. Displays the Save As dialog to let you save changes to a diagram in the active window.

•	Save As. Displays the Save As dialog to let you save a diagram with a new name.

•	BPwin .Imports a BPwin diagram or exports an ERwin diagram.

•	Designer 2000.Imports information from an Oracle Designer/2000 repository and exports ERwin model information to an Oracle Designer/2000 repository.

•	Dictionary Manager. Creates a dictionary for the target server that you select.

•	Print. Displays the Print Model dialog to let you print all or part of a diagram in the active window.

•	Print Setup. Opens the Print Setup dialog to let you set up your printer for printing ERwin diagrams.

•	Exit. Closes all windows and ends the current ERwin session.


ModelMart Menu

If ModelMart is installed at your site, and you computer is correctly set up to access the ModelMart, you can use the options on the ModelMart menu to work with ModelMart diagrams. See ModelMart Menu Options and Toolbar Buttons for more information.


Edit Menu

You use the options on the Edit menu to open editors for the diagram objects. Some of the menu options change or are unavailable when you switch from the logical model to the physical model. The following options appear on the Edit menu for both the logical and physical model.

•	Logical Model. Opens the current diagram in the logical model.

•	Physical Model. Opens the current diagram in the physical model.

•	Domain Dictionary. Opens the Domain Dictionary Editor to let you define new domains that capture the set of properties that you need for your model.

•	UDPs. Opens the User-Defined Property Editor to let you define new user-defined properties for model objects.

•	Subject Area. Opens the Subject Area Editor to let you select or change subject area members for your model.

•	Stored Display. Opens the Stored Display Editor to let you define new stored displays for your model.

•	Diagram. Opens the Diagram Editor to let you specify general diagram and database information.

•	Redraw Diagram. Redraws the current diagram.

•	Cut. Deletes the selected objects from the model or removes the selected objects from the subject area. You can choose to save to the clipboard.

•	Copy. Copies the selected objects to the clipboard.

•	Paste Model. Inserts the copied objects into the current diagram.

•	Select All. Selects all objects in the current diagram.

•	Go To. Selects the entity or table to activate.

The following options appear on the Edit menu for the logical model:

•	Entity. Opens the Entity Editor to let you specify the properties of an entity.

•	Attribute. Opens the Attribute Editor to let you create and maintain attribute properties for all entities in the diagram.

•	Relationship. Opens the Relationship Editor to let you specify the properties of a relationship.

•	Key. Opens the Key Group Editor to let you create and maintain key group properties.

The following options appear on the Edit menu for the physical model:

•	Volumetrics. Opens the Volumetrics Editor to let you can calculate the physical size of tables, indexes, and physical storage objects in a table and database.

•	Table. Opens the Table Editor to let you view and update the properties for each table in the physical schema.

•	Column. Opens the Column Editor to let you view and update the properties for each column in each table in the physical schema.

•	Relationship. Opens the Relationship Editor to let you specify the properties of a relationship.

•	Index. Opens the Index Editor to let you create new unique and non-unique indexes for tables in your data model.

•	Trigger. Opens the Trigger Template Editor to let you change the template that is attached to a referential integrity trigger type and view or modify the macro code used by a particular template.

•	View. Opens the View Editor to let you specify the properties of a view.

Additional options appear on the Edit menu when you select DM (Dimensional Modeling) notation for your physical model.

•	Data Warehouse Rule. Opens the Data Warehouse Rule Editor to let you define data warehouse management rules and attach rules to tables in your diagram.

•	Data Warehouse Source. Opens the Data Warehouse Source Editor to let you define or import the source of a data warehouse column.

Note:	You can double-click on an object in a diagram to open the default editor for that object.


Tasks Menu

You use the option on the Tasks menu to synchronize your data model with the database on the target server. The options on the Tasks menu include:

•	Forward Engineer/Schema Generation. Opens the <Database> Server Schema Generation Report dialog to let you create a new database schema from an ERwin data model or save the schema DDL script as an ASCII text file.

•	Reverse Engineer. Opens the Reverse Engineer - Set Options dialog to let you create a new ERwin data model from a SQL DDL or DL script or database catalog.

•	Update Model. Opens the Update Model - Set Options dialog to let you compare an ERwin data model with an existing database, schema script file, ERwin data model, or ModelMart diagram. Then you can preview the differences and selectively update your model.

•	Alter Database. Opens the Alter Database - Set Options dialog to let you compare an ERwin data model with an existing database, schema script file, ERwin data model, or ModelMart diagram. After you select the items and the changes that you want to add or update in your database, ERwin generates a schema script file that contains all the statements necessary to safely update your database. You can run the script directly against the database catalog or save the script as an ASCII text file and run it against the database catalog at a later time.

•	Complete Compare. Opens the Complete Compare - Set Options dialog to let you compare your data model with an existing database, schema script file, ERwin data model, or ModelMart diagram. When you choose the Complete Compare option, ERwin lists the differences between the source and target and lets you:

•	Update your data model based on changes to the database, SQL DDL script, ERwin model, or ModelMart diagram.

•	Create, preview, and save a SQL DDL change script that you can use to alter an existing database.

•	Update the database based on changes to the data model.

•	Generate Reports. Opens the Report Browser so you can browse and report on ERwin diagrams.


Client Menu

If you use either Visual Basic or PowerBuilder as a client development tool, you can use the options on the Client menu to define client-side column properties. See ERwin VB Client Menu and ERwin PB Client Menu for more information.


Server Menu

You use the options on the Server menu to define database objects and their properties for the selected target server. These options are only available for the physical model.

•	<Database> Trigger Template. Opens the Trigger Template Editor to let you change the template that is attached to an RI trigger type and view or modify the macro code used by a particular template.

•	<Database> Schema Property. Opens the Schema Properties Editor to let you view all of the stored procedures and pre and post-schema generation scripts that are attached to the schema. You can view the template code for each procedure and attach or detach procedures from the schema.

•	<Database> Physical Object. Opens the Physical Object Editor to let you create or modifiy physical storage objects for database tables.

•	Validation Rule. Opens the Validation Rule Editor to let you create or modify validation rules for database table columns.

•	Valid Value. Opens the Valid Value Editor to let you define the list of valid values that can be stored in a database column.

•	Default/Initial. Opens the Default/Initial Editor to let you create or modify default schema values for database table columns.

•	Target Sever. Opens the ERwin/ERX - Target Server dialog to let you select a target database management system (DBMS) to store the physical database that can be generated from or updated by an ERwin data model.

•	<Database> Connection. Connects to a target server.

•	Target Repository. Specifies the target repository when exchanging information with an Oracle Designer/2000 repository.


Option Menu

You use the options on the Option menu to set user preferences for objects in an ERwin window. The options on the Options menu include:

•	Unique Name. Opens the Unique Name Option dialog to let you specify rules for enforcing unique entity and attribute names.

•	Entity Size. Opens the Entity Size Options dialog to let you specify the height and width for entity boxes.

•	Default Font/Color. Opens the Default Font/Color Editor to let you specify default fonts and colors for the textual and graphical objects in an ERwin diagram.

•	Layout. Opens the Layout dialog to let you select layout grid options.

•	Preference. Opens the Preference dialog to let you set various preferences and customize the appearance of a diagram and ERwin menus.

•	Page Grid. Displays or hides page boundaries and numbers.

The following Structured Modeling Language (SML) options appear on the Option menu when you select the Show SML Editing option in the Preferences dialog.

•	SML Report. Opens the Generate ERwin SML Report dialog to let you save files in SML format.

•	SML Entity Note. Opens the SML Entity Notes Editor to let you create Structured Modeling Language (SML) notes for an entity. Appears only when you select the Show SML check box in the Preference dialog.

•	SML Attribute Note. Opens the SML Entity-Attribute Notes Editor to let you attach SML notes to the attributes in an entity. Appears only when you select the Show SML check box in the Preference dialog.

•	SML Relationship Note. Opens the SML Relationship Notes Editor to let you  attach SML notes to the relationships in your diagram. Appears only when you select the Show SML check box in the Preference dialog.


Window Menu

You use the options on the Window menu to display or hide some of the components of an ERwin window. The options on the Window menu include:

•	Stored Display Tabs. Displays or hides the stored display tabs.

•	Toolbar. Displays or hides the ERwin toolbar.

•	Font & Color Toolbar. Displays or hides the ERwin Font and Color toolbar.

•	ModelMart Toolbar. Displays or hides the ModelMart toolbar.

•	Status Bar.Displays or hides the status bar.

•	Independent Attribute Browser. Displays or hides the Independent Attribute Browser from which you can drag an independent attribute into an entity to create a new attribute (Logical model).

•	Independent Column Browser. Displays or hides the Independent Column Browser from which you can drag an independent column into a table to create a new column (Physical model).

•	ERwin Toolbox. Displays or hides the ERwin toolbox.

•	Cascade. Arranges windows so that they overlap.

•	Tile Horizontal. Arranges multiple ERwin diagram windows so that they appear side-by-side.

•	Tile Vertical. Arranges multiple ERwin diagram windows so that they appear vertically stacked.


Help Menu

You use the options on the Help menu to access the ERwin help topics. The options on the Help menu include:

•	ERwin Online Help. Opens the ERwin Online Help system.

•	Topic Index. Opens the help system to quickly find a particular help topic using the index feature.

•	ERwin Online Tutorial. Opens the ERwin Online Tutorial.

•	How to Use Help. Opens the help system to find information about how to use help.

•	What’s New. Opens a list of features that are new with this release of ERwin.

•	About ERwin. Opens the About ERwin dialog to display ERwin version and copyright information.


ERwin Shortcut Menus

ERwin provides an easier way to access most of the diagram object editors, display options, and display levels using shortcut menus. When you right-click on an object in the diagram window, or on the diagram background, ERwin displays a menu that contains options only for the selected object.

When you click on an object, you can use shortcut menus to access:

•	Editors

•	Diagram fonts and colors

•	Proceed directly to a specific parent and child entity or table

When you click on the diagram background, you can use shortcut menus to access:

•	Display levels

•	Display options

•	Zoom

•	Print scaling

•	Shadows

Hint:	Hold down the SHIFT key and double-click on a relationship line to display the Parent/Child Edit Selector. You can open the active editor for the parent or child entity or table.

Related Topics

  ERwin Menu Bar


ERwin Toolbar

The ERwin toolbar is located near the top of the ERwin window, and it contains a group of buttons that you use to perform common tasks. Each toolbar button is a shortcut that you can use instead of selecting a menu option. For example, you can use the Save toolbar button instead of choosing Save on the File menu.

The availability of the toolbar buttons varies, depending on the object that you have selected and whether you are working in the logical or physical model. You can view a description of each toolbar button by placing the mouse cursor on each button. To see a description for a toolbar button, click on it below.

Related Topics

  To display or hide the ERwin Toolbar


New Diagram Button

Displays a dialog to let you choose a template from which to start a new ERwin diagram.

Related Topics

  Creating a New ERwin Diagram


Open Diagram Button

Displays a dialog to let you open an existing ERwin diagram.

Related Topics

  Opening an ERwin Diagram


Save Diagram Button

Displays a dialog to let you save changes to the current diagram.

Related Topics

  Saving an ERwin Diagram


Print Diagram Button

Displays a dialog to let you print all or part of the current diagram.

Related Topics

  Printing an ERwin Diagram


Report Browser Button

Opens the Report Browser.

Related Topics

  Using the Report Browser with ERwin


Entity/Table Display Level Button

In the logical model, displays only the name of each entity inside an entity box. In the physical model, displays only the name of each table inside a table box.

Related Topics

  Entity Display Level

  Table Display Level


Attribute/Column Display Level Button

In the logical model, displays the attributes for each entity, with the primary key attributes above the line and the non-key attributes below the line. In the physical model, displays the column name and datatype for each table.

Related Topics

  Attribute Display Level

  Column_Display_Level


Entity/Table Definition Display Level Button

In the logical model, displays the definition for each entity. In the physical model, displays the comment for each table.

Related Topics

  Entity Definition Display Level

  Table Comment Display Level


Zoom Out Button

Decreases the magnification in increments of 25 percent.

Related Topics

  Changing the Diagram Magnification Level


Zoom In Button

Increases the magnification in increments of 25 percent.

Related Topics

  Changing the Diagram Magnification Level


No Magnification Button

Resets the magnification level to 100 percent.

Related Topics

  Changing the Diagram Magnification Level


Fit Model Button

Fits the entire diagram in the diagram window.

Related Topics

  Changing the Diagram Magnification Level


Select Rectangle to Fit Button

Lets you focus on a specific area of the diagram.

Related Topics

  Changing the Diagram Magnification Level


Forward Engineer Button

Opens the <Database> Server Schema Generation Report dialog to let you create a new database schema from an ERwin data model or save the schema DDL script as an ASCII text file. Available only for the physical model.

Related Topics

  Forward Engineering/Generating a Database Schema


Complete Compare Button

Opens the Complete Compare - Set Options dialog to let you compare your data model with an existing database, schema script file, ERwin data model, or ModelMart diagram.

Related Topics

  Setting Synchronization Options When Updating a Model


Select Target Server Button

Opens the ERwin/ERX - Target Server dialog to let you select a target database management system (DBMS).

Related Topics

  Selecting the Target Server


ModelMart Button

Displays or hides the ModelMart toolbar.

Related Topics

  The ModelMart Toolbar


Create Subject Area Button

Opens the Subject Area Editor to let you select or change subject area members for your model.

Related Topics

  Using Subject Areas to Manage Large Diagrams


Select Subject Area Button

Lets you select and switch to a subject area in the current diagram.

Related Topics

  Using Subject Areas to Manage Large Diagrams


Logical/Physical Model Option Button
Logical/Physical Model Option List

Lets you switch between the logical model and the physical model.

Related Topics

  Using ERwin's Logical and Physical Modeling Features


To display or hide the ERwin Toolbar

•	Choose Toolbar on the Window menu.


ERwin Font and Color Toolbar

The ERwin font and color toolbar is located directly below the ERwin toolbar. The ERwin font and color toolbar contains a group of buttons that you use to change the font or color of diagram objects, and it lists all of the fonts that are available on your workstation. It also has separate buttons to modify the text color, object fill color, and outline color. You can view a description of each toolbar button by placing the mouse cursor on each button. To see a description for a toolbar button, click on it below.

Related Topics

  Using the ERwin Font and Color Toolbar

  To display or hide the ERwin Font and Color Toolbar


Change Font Display Button

Choose a font for the selected object.

Related Topics

  To change an object's font


Change Point Size Button

Choose a point size for the selected object.

Related Topics

  To change an object's font


Bold, Italics, Underline Button

Apply bold, italics, or underline to the selected object.

Related Topics

  To change an object's font


Text Color/Select Text Color Button

Apply or select the color for diagram text.

Related Topics

  To change an object's font


Fill Color/Select Fill Color Button

Apply or select the fill color for an object.

Related Topics

  To change an object's font


Outline Color/Select Outline Color Button

Apply or select the outline color for an object.

Related Topics

  To change an object's font


To display or hide the ERwin Font and Color Toolbar

•	Choose Font & Color Toolbar on the Window menu.


Independent Attribute Browser and Independent Column Browser

To help you reuse domains throughout your model, ERwin displays all logical domains in the Independent Attribute Browser and all physical domains in the Independent Column Browser.

By default, the Independent Attribute Browser displays in the logical diagram window or the Independent Column Browser displays in the physical diagram window when you start ERwin the first time.

You create an independent attribute or an independent column in the Domain Dictionary Editor, then you can drag an independent attribute into an entity to create a new owned attribute or drag an independent column into a table to create an owned column.

Related Topics:

  To display or hide the Independent Attribute Browser

  To display or hide the Independent Column Browser


To display or hide the Independent Attribute Browser

•	Choose Independent Attribute Browser on the Window menu when in the logical model.

Hint:	Press CTRL+B to display or hide the Independent Attribute Browser.


To display or hide the Independent Column Browser

•	Choose Independent Column Browser on the Window menu when in the physical model.

Hint:	Press CTRL+B to display or hide the Independent Column Browser.


ERwin Toolbox

By default, the ERwin toolbox is located in the diagram window. The ERwin toolbox contains a group of tools that you use to perform common tasks such as creating an entity, a table, or a relationship.

The toolbox changes when you switch from IDEF1X to IE notation and some of the tools change for logical and physical model. A different toolbox is available for the dimensional model.

The toolboxes that you can use in ERwin are as follows:

•	IDEF1X Logical model toolbox

•	IDEF1X Physical model toolbox

•	IE Logical model Toolbox

•	IE Physical model Toolbox

•	DM Physical Model Toolbox

You can view a description of each toolbox button by placing the mouse cursor on each button. If you work in multiple diagram windows, ERwin remembers the last tool that you selected for each window. Therefore, you can immediately use that tool when you return to the window.

Related Topics

  To display or hide the ERwin Toolbox


To display or hide the ERwin Toolbox

•	Choose ERwin Toolbox on the Window menu.

Hint:	Press Ctrl+T to display or hide the ERwin toolbox.


IDEF1X Logical Model Toolbox

When you work in the logical model using IDEF1X notation, you use the toolbox to perform data modeling tasks such as adding entities, relationships, and subtype relationships. To see a description for a toolbox button, click on it below.


Select Button

Lets you select objects for editing. You cannot use the Select button to select attributes for editing. You can select entities and relationships for general diagram editing tasks.

Related Topics

  Selecting Multiple Diagram Objects


Independent Entity Button

Inserts a new independent entity when you click on the diagram.

Related Topics

  Creating an Entity


Complete Subtype Button

Inserts a complete subtype relationship when you click on a parent then a child entity.

Related Topics

  To create a complete subtype relationship

  To create an incomplete subtype relationship


Text Block Button

Inserts a text block when you click on the diagram.

Related Topics

  Using Text Blocks


Attribute Manipulation Button

Copies or moves attributes within the same entity.

Related Topics

  Copying Attributes or Columns in a Diagram


Identifying Relationship Button

Inserts an identifying relationship when you click on the parent then the child entity.

Related Topics

  Creating an Identifying Relationship in the Logical Model


Many-to-Many Relationship Button

Inserts a many-to-many relationship when you click on the first entity in the relationship, then the next entity.

Related Topics

  Creating a Many-to-Many Relationship

  Resolving Many-to-Many Relationships


Non-identifying Relationship Button

Inserts a non-identifying relationship when you click on the parent then the child entity.

Related Topics

  Creating a Non-Identifying Relationship in the Logical Model


IDEF1X Physical Model Toolbox

When you work in the physical model using IDEF1X notation, you use the toolbox to perform data modeling tasks such as adding tables, views, and relationships. To see a description for a toolbox button, click on it below.


Select Button

Lets you select objects for editing. You cannot use the Select button to select columns for editing. You can select tables and relationships for general diagram editing tasks.

Related Topics

  Selecting Multiple Diagram Objects


Independent Table Button

Inserts a new independent table when you click on the diagram.

Related Topics

  Creating a Table


View Table Button

Inserts a new view table when you click on the diagram.

Related Topics

  Creating a View


Text Block Button

Inserts a text block when you click on the diagram.

Related Topics

  Using Text Blocks


Attribute Manipulation Button

Copies or moves columns within the same table.

Related Topics

  Copying Attributes or Columns in a Diagram


Identifying Relationship Button

Inserts an identifying relationship when you click on the parent then the child table.

Related Topics

  Creating an Identifying Relationship in the Physical Model


View Relationship Button

Inserts a view relationship when you click on the parent then the child table.

Related Topics

  Using the View Relationship Editor


Non-identifying Relationship Button

Inserts a non-identifying relationship when you click on the parent then the child table.

Related Topics

  Creating a Non-Identifying Relationship in the Physical Model


IE Logical Model Toolbox

When you work in the logical model using IE notation, you use the toolbox to perform data modeling tasks such as adding entities, relationships, and exclusive subtype relationships. To see a description for a toolbox button, click on it below.


Select Button

Lets you select objects for editing. You cannot use the Select button to select attributes for editing. You can select entities and relationships for general diagram editing tasks.

Related Topics

  Selecting Multiple Diagram Objects


Independent Entity Button

Inserts a new independent entity when you click on the diagram.

Related Topics

  Creating an Entity


IE Exclusive Subtype Button

Inserts a complete subtype relationship when you click on a parent then a child entity.

Related Topics

  Creating a Subtype Relationship


Text Block Button

Inserts a text block when you click on the diagram.

Related Topics

  Using Text Blocks


Attribute Manipulation Button

Copies or moves attributes within the same entity.

Related Topics

  Copying Attributes or Columns in a Diagram


Identifying Relationship Button

Inserts an identifying relationship when you click on the parent then the child entity.

Related Topics

  Creating an Identifying Relationship in the Logical Model


Many-to-Many Relationship Button

Inserts a many-to-many relationship when you click on the parent then the child entity.

Related Topics

  Creating a Many-to-Many Relationship


Non-identifying Relationship Button

Inserts a non-identifying relationship when you click on the parent then the child entity.

Related Topics

  Creating a Non-Identifying Relationship in the Logical Model


IE Physical Model Toolbox

When you work in the physical model using IE notation, you use the toolbox to perform modeling tasks such as adding tables, relationships, and views. To see a description for a toolbox button, click on it below.


Select Button

Lets you select objects for editing. You cannot use the Select button to select columns for editing. You can select tables and relationships for general diagram editing tasks.

Related Topics

  Selecting Multiple Diagram Objects


Independent Table Button

Inserts a new independent table when you click on the diagram.

Related Topics

  Creating a Table


View Table Button

Inserts a new view table when you click on the diagram.

Related Topics

  Creating a View


Text Block Button

Inserts a text block when you click on the diagram.

Related Topics

  Using Text Blocks


Attribute Manipulation Button

Copies or moves columns within the same table.

Related Topics

  Copying Attributes or Columns in a Diagram


Identifying Relationship Button

Inserts an identifying relationship when you click on the parent then the child table.

Related Topics

  Creating an Identifying Relationship in the Physical Model


View Relationship Button

Inserts a view relationship when you click on the parent then the child table.

Related Topics

  Using the View Relationship Editor


Non-identifying Relationship Button

Inserts a non-identifying relationship when you click on the parent then the child table.

Related Topics

  Creating a Non-Identifying Relationship in the Physical Model


DM Physical Model Toolbox

When you work in the physical model using DM notation, you use the toolbox to perform dimensional modeling tasks such as adding tables, relationships, and views. To see a description for a toolbox button, click on it below.


Select Button

Lets you select objects for editing. You cannot use the Select button to select columns for editing. You can select tables and relationships for general diagram editing tasks.

Related Topics

  Selecting Multiple Diagram Objects


Independent Table Button

Inserts a new independent table when you click on the diagram.

Related Topics

  Creating a Table


View Table Button

Inserts a new view table when you click on the diagram.

Related Topics

  Creating a View


Text Block Button

Inserts a text block when you click on the diagram.

Related Topics

  Using Text Blocks


Attribute Manipulation Button

Copies or moves columns within the same table.

Related Topics

  Copying Attributes or Columns in a Diagram


Identifying Relationship Button

Inserts an identifying relationship when you click on the parent then the child table.

Related Topics

  Creating an Identifying Relationship in the Physical Model


View Relationship Button

Inserts a view relationship when you click on the parent then the child table.

Related Topics

  Using the View Relationship Editor


Non-identifying Relationship Button

Inserts a non-identifying relationship when you click on the parent then the child table.

Related Topics

  Creating a Non-Identifying Relationship in the Physical Model


ERwin Diagram Window

During your logical and physical modeling, you perform all of your work in the ERwin diagram window. Each diagram window contains all of the objects that you use to design a logical or physical model, such as entities, relationships, tables, attributes, and columns. It also includes:

•	Title bar

•	Menus

•	ERwin toolbar

•	ERwin font and color toolbar

•	ERwin toolbox

•	Stored display tabs

•	Status Bar

Related Topics

  Navigating Using the Keyboard


Stored Display Tabs

The stored display tabs are located at the bottom of the ERwin diagram window. Stored display tabs identify each stored display that you have added for the current diagram. By default, ERwin creates the first stored display, names it "Display1," and displays a tab for it at the bottom of the ERwin diagram window. You can change the name of the stored display in the Stored Display Editor.

Related Topics

  Working With Stored Displays

  To display or hide the Stored Display Tabs


To display or hide the Stored Display Tabs

•	Choose Stored Display Tabs on the Window menu.


Status Bar

The status bar is located at the bottom of the ERwin diagram window. The status bar provides a description for the selected button, menu option, or task that ERwin is performing, and identifies the selected target server.

Related Topics:

  To display or hide the Status BarTo_display_or_hide_the_Status_Bar>proc


To display or hide the Status Bar

•	Choose Statusbar on the Window menu.


Navigating Using the Keyboard

There are several keys and key combinations that you can use to help you move through ERwin diagrams and dialogs. You can use these key combinations instead of using the mouse.

Navigation Key	Description
TAB	♦ In a diagram to move the cursor from attribute to attribute in an entity or table box. ♦ In a dialog to move the cursor to each control from left to right, top to bottom.
ENTER	♦ In a diagram to access the default editor for the selected object and move the cursor from attribute to attribute in an entity or table box. ♦ In a dialog to execute the default button.
HOME	♦ In a text box to move the cursor to the first position in the text box.
END	♦ In a text box to move the cursor to the last position in the text box.
UP ARROW	♦ In a diagram to scroll up one line. ♦ In a dialog to move the cursor to the previous position in a text box, move the cursor to the previous radio button, or move the cursor through the items in a drop-down list.
DOWN ARROW	♦ In a diagram to scroll down one line. ♦ In a dialog to move the cursor to the next position in a text box, move the cursor to the next radio button, or move the cursor through the items in a drop-down list.
RIGHT ARROW	♦ In a diagram to scroll one step to the right. ♦ In a text box to move the cursor right one character.
LEFT ARROW	♦ In a diagram to scroll one step to the left. ♦ In a text box to move the cursor left one character.
PAGE UP	♦ In a diagram to scroll up one page.
PAGE DOWN	♦ In a diagram to scroll down one page.
ESC	♦ In a dialog to cancel the command and close the dialog. ♦ In a diagram to cancel on-diagram editing.
DELETE	♦ In a diagram to prompt the user to delete the selected object from the subject area, from the model, or copy it to the clipboard. See Deleting Diagram Objects for more information.
BACKSPACE	♦ In a text box to delete the selected character and move the cursor back one position. Deletes selected text.
SPACEBAR	♦ In a diagram to activate the selected object in an entity or table box for editing.
SHIFT + TAB	♦ In a diagram to move the cursor from object to object in reverse order. ♦ In a dialog to move the cursor from attribute to attribute in reverse order.
SHIFT + ENTER	♦ In a diagram to stop on-diagram editing.
CTRL + RIGHT ARROW	♦ In a diagram to scroll one page to the right.
CTRL + LEFT ARROW	♦ In a diagram to scroll one page to the left.
CTRL + HOME	♦ In a diagram to scroll to the top of the ERwin diagram window. ♦ In a dialog to move the cursor to the first space in a text box.
CTRL + END	♦ In a diagram to scroll to the bottom of the ERwin diagram window. ♦ In a dialog to move the cursor to the last space in a text box.
F4	♦ In drop-down lists to display a list of valid items.
ALT + F4	♦ Exits ERwin.
F10	♦ Toggles between an active and inactive status bar.


Using ERwin's Logical and Physical Modeling Features

In ERwin, you can include both a logical and a physical model in a single ERwin diagram. The logical model supports the needs of the data modeler who must represent business information and define business rules. The physical model supports the needs of the database administrator, who focuses on the physical implementation of the model in a database.

By default, the logical model is closely related to the physical model. If you make a change in the logical model, the change is automatically reflected in the physical model, and vice-versa. However, the logical and physical models can look very different, depending on the notation selected (IDEF1X , IE , or DM ), and the display options selected.

You can use ERwin to create a logical model that is different from, but related to a physical model. For example, you can flag certain objects in the logical model as “logical only” so that they do not appear in a corresponding physical model, and vice versa.

Other items are available for one modeling environment, but not the other. For example, you can create many-to-many relationships and subtype relationships in the logical model (these constructs must be resolved in the physical model), and you can include views and view relationships in the physical model only.

ERwin’s support for the separation of the logical model from the physical model also includes features and options in the user interface and ERwin editors, including:

•	Options for choosing objects to appear only in the logical model or the physical model

•	Separate editors for the logical and physical model

•	Optionally, using separate modeling notation for the logical and physical model

•	Distinct display levels for the logical and physical model

•	Distinct display options for the logical and physical model

Related Topics

  Switching Between the Logical and Physical Models


Comparing Logical and Physical Objects

Most of the objects in the logical model correspond to a related object in the physical data model. For example, the logical model contains entities, attributes and key groups, which are represented in the physical model as tables, columns, and indexes. The following table compares the logical and physical objects in an ERwin model.

Summary of Corresponding Logical and Physical Objects

Logical Object	Physical Object
Entity	Table
Dependent entity	FK is part of child table’s PK
Independent entity	Parent table or, if child table, FK is NOT part of child table’s PK
Attribute	Column
Logical datatype (text, number, datetime, blob)	Physical datatype (such as char(18), int, or varchar)
Domain (logical)	Domain (physical)
Primary key	Primary key in the diagram and PK Index in the schema
Foreign key	Foreign key in the diagram and FK Index in the schema
Alternate key (AK)	A unique, non-primary index
Inversion entry (IE)	A non-unique index
Key group	Index
Business rule	Trigger or stored procedure
Validation rule	Constraint
Relationship	Relationship implemented using FKs
Identifying	FK is part of child table’s PK (above the line)
Non-Identifying	FK is NOT part of child table’s PK (below the line)
Subtype	Denormalized tables
Many-to-many	Associative table
Referential Integrity  (cascade, restrict, set   null, set default)	INSERT, UPDATE, and DELETE Triggers
Cardinality	INSERT, UPDATE, and DELETE Triggers
N/A	View or view relationship
N/A	Pre- and post-script
Note:	You can specify whether an object is included in the logical or physical model, or both using the “Logical Only” and “Physical Only” check boxes in the corresponding ERwin editor.

Related Topics

  To display an entity in the logical model only

  To display a table in the physical model only

  To display a relationship the logical model only

  To display a relationship the physical model only

  Resolving Many-to-Many Relationships


Summary of Logical and Physical Object Editors

To support logical and physical model separation, you use various editors to modify the properties for an object. For example, in the logical model you use the Entity Editor to modify the properties for an entity. In the physical model, you use the Table Editor to modify the properties for a database table. The following table summarizes the corresponding editors that you can use in both the logical and physical model.

Logical Model Editor	Physical Model Editor
Entity Editor	Table Editor
Attribute Editor	Column Editor
Domain Dictionary Editor (logical)	Domain Dictionary Editor (physical)
Relationship Editor (logical)	Relationship Editor (physical)
Key Group Editor	Index Editor
N/A	View Editor
N/A	Trigger Editor
Stored Display Editor	Stored Display Editor
Subject Area Editor	Subject Area Editor


Logical and Physical Modeling Notation

For entity relation data models, you can specify whether ERwin uses IDEF1X or IE notation for the objects in both the logical and physical data model. If you prefer, you can use a different notation to help you distinguish between the logical and physical model.

For dimensional models, you can specify IDEF1X or IE notation in the logical model and select DM (Dimensional Modeling) for the physical model. You can also choose whether to have ERwin display conformance warnings based on dimensional modeling rules.

Related Topics

  Working with IDEF1X, IE, and DM Notation

  Selecting Modeling Notation Preferences


Logical and Physical Modeling Display Levels

ERwin provides two sets of display levels, one for the logical model and one for the physical model. The display levels are available using the shortcut menus, and are also available on the Logical and Physical tabs in the Stored Display Editor.

Related Topics

  ERwin Shortcut Menus

  Using the Stored Display Editor

  Changing Logical Display Levels

  Changing Physical Display Levels


Logical and Physical Modeling Display Options

ERwin provides two sets of corresponding display options, one for the logical model and one for the physical model. The display options are available using the shortcut menus, and are also available on the Logical and Physical tabs in the Stored Display Editor.

Related Topics

  ERwin Shortcut Menus

  Using the Stored Display Editor

  Changing Logical Display Options

  Changing Physical Display Options


Switching Between the Logical and Physical Models

You can easily switch from the logical model to the physical model and back to the logical model simply by selecting an option from the Logical/Physical Model option list on the ERwin toolbar. ERwin identifies the physical model as Dimensional in the option list when you use Dimensional Modeling (DM) notation.

You can also choose the Logical Model or Physical Model option on the Edit menu to change which model is displayed. Both options are available regardless of the diagram, subject area, or stored display that you select.

Related Topics

  ERwin Toolbar

  ERwin Edit Menu

  To switch between the logical and physical models


To switch between the Logical and Physical Models

•	To switch to the logical model, select the Logical option from the list in the ERwin toolbar.

•	To switch to the physical model in a data model, select the Physical option from the list in the ERwin toolbar.

•	To switch to the physical model in a dimensional model, select the Dimensional option from the list in the ERwin toolbar.


Working with IDEF1X, IE, and DM Notation

When you work in the logical and physical data model, you can choose whether ERwin uses Integration DEFinition for Information Modeling (IDEF1X) notation or Information Engineering (IE) notation. The IDEF1X and IE notations use different symbols to represent entity and table relationships. The default notation that ERwin uses for both the logical and physical model for the Blank diagram template is IDEF1X, but you can switch to IE notation at any time in either model.

When you select DM (Dimensional Modeling) notation for your physical model you can take advantage of ERwin’s data warehouse support features and enforce star schema diagramming standards.  DM (Dimensional Modeling) notation is the default for the physical model for the DIMENS template.

Related Topics

  Using IE Notation

  Relationship and Cardinality Symbols

  Selecting Modeling Notation Preferences

  To use IE Notation

  To use IDEF1X Notation

  To use DM notation


Using IE Notation

If you use IE notation for data modeling, you can use different symbols to represent objects in an ERwin data model. The standard IE notation has been modified slightly to take advantage of certain ERwin features. For example, you can use a solid line to represent an identifying relationship and a dotted line to represent a non-identifying relationship, which is not a standard IE notation convention.

The ERwin toolbox that displays when you use IE notation contains a group of buttons that you use to perform common tasks. There are two toolboxes that you can use in ERwin using IE notation:

•	IE Logical model toolbox

•	IE Physical model toolbox

You can view a description of each toolbox button by placing the mouse cursor on each button. If you work in multiple diagram windows, ERwin remembers the last tool that you selected for each window. Therefore, you can immediately use that tool when you return to the window.

Related Topics

  Using IE Notation for Subtype Relationships

  To use IE Notation


Relationship and Cardinality Symbols

The following chart shows how ERwin relationship and cardinality information is represented in IDEF1X, IE, and DM (Dimensional Modeling) notation.

Cardinality Description	IDEF1X Notation Identifying Non-identifying Nulls No Nulls	IE Notation Identifying Non-identifying Nulls No Nulls	DM Notation Identifying Non-identifying Nulls No Nulls
One to zero, one, or more
One to one or more (P)
One to zero or one (Z)
One to exactly (N)
Related Topics:

  To display cardinality in the logical model

  To display cardinality in the physical model

  Cardinality Display Option (Logical)

  Cardinality Display Option (Physical)


Subtype Relationships Using IE Notation

Unlike IDEF1X, IE notation does not distinguish between complete and incomplete subtype relationships. Therefore, when ERwin converts a subtype relationship from IDEF1X to IE notation, it determines if the relationship is exclusive or inclusive.

In an exclusive subtype relationship, an attribute in the supertype entity can derive its value from only one subtype entity. For example, if a data model includes an EMPLOYEE supertype entity with FULL-TIME and PART-TIME subtype entities, the employee-status attribute value for each employee can be full-time or part-time, but not both.

In an inclusive subtype relationship, an attribute in the supertype can derive its value from one or more subtype categories. For example, if a bank’s data model includes an ACCOUNT supertype entity with CHECKING-ACCOUNT, SAVINGS-ACCOUNT, and LOAN-ACCOUNT subtype entities, the <account> indicator attribute can be checking, savings, or loan because a bank customer can have any combination of accounts that the bank offers.

In IDEF1X notation, you can assign a different subtype discriminator to each subtype symbol. When ERwin converts a diagram from IDEF1X to IE notation, it automatically discards the subtype discriminator symbols. See Creating a Subtype Relationship for more information.

Note:	When ERwin converts a diagram from IE to IDEF1X notation, it changes all subtypes into their original IDEF1X form. If the diagram was originally created using IE notation, ERwin converts all subtypes into complete subtypes. After conversion, you can manually delete the complete subtype relationship and create an incomplete subtype relationship.

Related Topics

  Subtype Conversion in IDEF1X and IE Notation


Subtype Conversion in IDEF1X and IE Notation

The following chart shows how ERwin converts the subtypes in a diagram from IDEF1X notation to IE notation.

Explanation	IDEF1X Notation Subtype Complete Incomplete	IE Notation Subtype
ERwin converts IDEF1X subtype relationships to an IE exclusive relationship when one connector links multiple subtypes to the supertype entity.
ERwin converts IDEF1X subtype relationships to an IE inclusive relationship when a separate connector links individual subtypes to the supertype entity.


To use IE notation

1.	Choose Preferences on the Option menu.

2.	Click the Methodology tab.

3.	Click the IE button in the Logical Notation and Physical Notation group boxes.

4.	Click OK.


To use IDEF1X notation

1.	Choose Preferences on the Option menu.

2.	Click the Methodology tab.

3.	Click the IDEF1X button in the Logical Notation and Physical Notation group boxes.

4.	Click OK.


To use DM notation

1.	Choose Preferences on the Option menu.

2.	Click the Methodology tab.

3.	Click the DM button in the Physical Notation group boxes.

4.	Click OK.


Finding Entities, Tables, and Views

You can use ERwin to find a specific entity, table, or view in your diagram using the “Go To” feature. This features is helpful if you have a large diagram and the entity, table, or view that you want to find is not in the current diagram window. The purpose of each control in the Go To dialog is explained below:

•	Entity/Table. Displays all of the entities, tables, and view in the active model. Select the entity, table, or view to find or enter the first letters of its name.

•	Open Editor. Click this button to find the entity, table, or view and automatically open the current editor for it.

•	Show Entity Names. Click this button to display the logical entity names for tables and views. Displays only in the physical model.

•	Show Table Names. Click this button to display the physical table/view names for entities. Displays only in the logical model.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To find an entity, table, and view


To find an entity, table, and view

1.	Choose Go To on the Edit menu.

2.	Select the entity, table, or view that you want to find in the Entity or Table text box.

3.	Choose one or more of the following options:

•	To display the physical table/view names for entities, click the Show Table Names button.

•	To display the logical entity names for tables/views, click the Show Entity Names button.

•	To find the entity, table, or view and automatically open the current editor for it, click the Open Editor button.

4.	Click OK.

Note:	Click CTRL + G to open the Go To dialog


IDEF1X

ICAM Definition Method 1 Extended. A methodology for graphically depicting entities, tables, columns, attributes, and relationships.


IE

Information Engineering (Martin). A methodology for graphically depicting entities, tables, columns, attributes, and relationships.


Using On-Grid Editing

ERwin uses an editable grid in three new editors, the User-Defined Property Editor, the Data Warehouse Rule Editor, and the Data Warehouse Source Editor. For example, the editable grid in the UDP Editor looks like this:

Summary of On-grid editing features:

To…	Do this…
Add a row	Click the [image] button to add a row.
Delete a row	Click the [image] button to delete a row. A confirmation message displays. Click Yes to delete the row, or click No to cancel  the deletion.
Sort rows from A-Z	Click on column headings that are three-dimensional buttons.
Sort rows by rule type (Data Warehouse Rule Editor)	Click the Type column, to sort rows from A-Z by rule type order. Rule Type order is: Refresh, Append, Backup, Recovery, Archiving, and Purge.
Sort rows  (UDP Editor)	Click the [image] and [image] buttons to move the selected row up or down in the grid.
Edit a value	Select the value you want to change and type the new value.
Select an available option	Click in the cell and click the [image] button to display the list. Select a different option from the list.
Related Topics

  Creating User-Defined Properties

  Using the Data Warehouse Rule Editor

  Using the Data Warehouse Source Editor


Starting the Report Browser

You can open the Report Browser by clicking the [image] button on the ERwin toolbar or choosing Generate Reports from the Tasks menu.

Related Topics

  To start the Report Browser


To start the Report Browser

•	Click the [image] button on the ERwin Toolbar or choose Generate Reports on the Tasks menu. The main Report Browser window is displayed on the screen.


Using the Report Browser with ERwin

The Report Browser is a versatile and highly-customizable tool for browsing and generating reports on ERwin diagrams and ModelMart information.

If you are using ERwin without a connection to ModelMart, the Report Browser provides a set of predefined report types (categories) for ERwin diagrams. Each report type contains a rich set of related options that you can include or exclude in your report. Some report types also provide built-in filtering and sorting options. You select a report category and use it as the basis for creating a report that includes only the options you want. Once you create the report, it appears in a folder under the ERwin Report node of tree control on the left side of the main Report Browser window.

To generate a report, simply double-click on the report icon ( [image]) or the editable report icon ( [image]). The Report Browser shows the result set generated by the report in the Result Set pane on the right side of the window. A result set icon ( [image]) is also added to the tree control under the report icon. You can then use the Report Browser’s extensive range of features to further customize the content and change the appearance of the result set.

The Report Browser has features that let you find the information you want in a result set. You can specify a search expression (which can include strings, numbers, or dates) for one or more columns so that the Report Browser finds only the result set rows that satisfy all the search expressions. You can also find a change of value in a column and hide result sets rows that do not match the search.

If you are using ERwin with a connection to ModelMart, the Report Browser provides two sets of predefined reports organized in a folder tree under two folders called General and ModelMart <Name>. See Using the Report Browser with ModelMart  for more information.


Using Standard ERwin Reports

The Report Browser includes a set of standard ERwin reports that you can use to report on the active ERwin or ModelMart diagram. This report set includes all of the standard reports supplied with earlier versions of ERwin and many new standard reports.

The following table shows the name of each standard report supplied with earlier ERwin versions and the corresponding report name and location under the ERwin Reports folder in the Report Browser. The name of the report in the Report Browser column in the table below reflects the content of the report.

ERwin Version 2.x	Report Browser
Type	Report Name	Folder	Report Name
Entity Report	<Std Entity Report STDENT1>	Entity Report	Entity/Definition/Table/ Attribute/ Column/PK/FK/Relationships
	<Std Entity Report STDENT2>		Entity/Attribute/Column
	<Std Entity Report STDENT3>		Entity/Primary Key
	<Std Entity Report STDENT4>		Entity/Trigger Options
	<Std Entity Report STDENT5>		Entity/Trigger Options
Attribute Report	<Std Att Report STDATT1>	Attribute Report	Attribute/Rolename/Column Information/Entity/Constraints
	<Std Att Report STDATT2>		Logical and Physical Column Information
	<Std Att Report STDATT3>		Attribute/Column Options/Constraint Options
Relationship Report	<Std Rel Report STDREL1>	Parent-to-Child Phrase	Relationship Phrase/Parent/Child/Rules
Constraint Report	<Std Con Report STDCON1>	N/A	Physical Domain/Default/ Validation/Column
	<Std Con Report STDCON2>		Physical Domain/Default/ Validation/Column
	<Std Con Report STDCON3>		Physical Domain/Validation/ Column
Subject Area Report		N/A	Logical Subject Areas
			Physical Subject Areas


Creating an ERwin Report

You can use the Report Browser to report on ERwin diagrams. After you open the Report Browser, you can create a new report in one of two ways:

•	Choose New ERwin Report on the File menu.

•	Click the New ERwin Report button [image] in the toolbar then double-click on the report item in the New Object dialog.

The Report Browser opens the ERwin Report Editor dialog so that you can choose the report type (such as, entity report, attribute report, and so on) and select the information you want to appear in the report.

The purpose of each control in the ERwin Report Editor is explained below:

•	Name. Enter or edit the name of your ERwin report.

•	Category. Select the type of report you want to generate. The options in the list change depending on whether the Logical or Physical button is selected.

•	Logical. Select this button to filter the Category list to show only logical reports, that is reports on logical objects such as entities, attributes, key groups and so on.

•	Physical. Select this button to filter the Category list to show only physical reports, that is reports on physical objects such as tables, columns, indexes and so on.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

The ERwin Report Editor includes the following tabs. Click the appropriate tab to specify the properties of the ERwin report:

•	Options. You use this tab to specify the content of the selected ERwin Report.

•	Definition. You use this tab to enter or edit a definition for the selected ERwin Report.

•	Note. You use this tab to enter or edit a note for the selected ERwin Report.

Related Topics

  To create an ERwin report


Specifying the Content of an ERwin Report

In the Options tab in the ERwin Report Editor you can specify the information you want to include in your ERwin report. The options you select become columns in a result set generated by the report. A pencil icon ( [image]) next to an option indicates that the corresponding column in the generated result set will be editable. See Generating an ERwin Report  for more information.

The purpose of each control in the Options tab is explained below:

•	Options. Displays the information you can include in your ERwin report. The options available depend on the report type selected in the Category list. Click the [image] next to a folder to expand it or click the [image] to collapse a folder. Within a folder ( [image]), there can be three possible types of options as follows:

•	 Check box options: Select the check box next to an item to include it in the report. Clear the check box next to an item to exclude it.

•	 Filter options: Click the  [image] next to a filter symbol to view the filter options, then click one or more of the filter option buttons to include only rows that satisfy the filter criteria.

•	 Sort By options: Click the  [image] next to a sort by symbol to view the sort options, then click the sort option button you want.

•	Show Selected. Expands only folders in the Options list that contain selected items. Unselected items in these folders are also shown.

•	Collapse All. Closes all open folders except the first folder.

•	Clear All. Clears all previously selected options.

The purpose of each control in the Options group box is explained below:

•	Edit. Click this button to display all report options in the Options list.

•	Show Selected Only. Click this button to display only the currently selected report options in the Options list.

Related Topics

  Creating an ERwin Report

  To create an ERwin report

  Reporting User-Defined Properties


To create an ERwin report

1.	Click the [image] button in the toolbar then double-click on the report item in the New Object dialog.

2.	Type a name for your report in the Name box.

3.	Choose one of the following options:

•	To report on logical model objects, click Logical.

•	To report on physical model objects, click Physical.

4.	Select the type of report you want in the Category list.

5.	Select the information you want to include in the report from the Options tree control as follows:

•	Click the [image] symbol next to a folder to expand it.

•	Click the [image] symbol next to a folder to collapse it.

•	Select the check box next to an option to include that information in the report. A pencil icon ( [image]) next to an option indicates that the corresponding column in the generated result set ( [image]) will be editable.

•	Click the [image] symbol next to a Filter By folder to view the filtering options. Click one or more of the filter options to include only rows in the report that satisfy the filter options selected.

•	Click the [image] symbol next to a Sort By folder to view the sorting options. Click on one of the Sort By buttons to sort the report rows using the option you select.

•	Click the Show Selected Only button to display only the options you have checked for your report and view your selections.

6.	Optionally, click on the Definition tab and type a definition for the report.

7.	Optionally, click on the Note tab and type a note for the report.

8.	Click OK. The Report Browser adds your report to the tree control in the main Report Browser window.

9.	Click [image] to run the report against the active ERwin diagram. More>


To edit an ERwin Report

1.	Select the folder that contains the ERwin report you want to edit.

2.	Click on the ERwin report to select it.

3.	Click the [image] button on the tree control toolbar. The Report Browser opens the ERwin Report Editor dialog.

4.	Edit the information in the Options tree control:

•	Click the [image] symbol next to a folder to expand it.

•	Click the [image] symbol next to a folder to collapse it.

•	Select the check box next to an option to include that information in the report. A pencil icon ( [image]) next to an option indicates that the corresponding column in the generated result set ( [image]) will be editable.

•	Click the [image] symbol next to a Filter By folder to view the filtering options. Click one or more of the filter options to include only rows in the report that satisfy the filer options selected.

•	Click the [image] symbol next to a Sort By folder to view the sorting options. Click on one of the Sort By buttons to sort the report rows using the option you select.

•	Click the Show Selected Only button to display only the options you have checked for your report.

5.	Optionally, click on the Definition tab and type a definition for the report in the Definition box.

6.	Optionally, click on the Note tab and type a note for the report in the Note box.

7.	Click OK. The Report Browser updates the report.

8.	Click [image] to run the report against the active ERwin diagram. More>


Entering or Editing a Definition for an ERwin Report

You can use the Definition tab in the ERwin Report Editor to type or edit a definition for the selected ERwin report.

The purpose of each control in the Definition tab is explained below:

•	Definition. Type or edit a definition for the selected ERwin report.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Creating an ERwin Report

  To create an ERwin report


Entering or Editing a Note for an ERwin Report

You can use the Note tab in the ERwin Report Editor to type or edit a note for the selected ERwin report.

The purpose of each control in the Note tab is explained below:

•	Note. Type or edit a note for the selected ERwin report.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Related Topics

  Creating an ERwin Report

  To create an ERwin report


Generating an ERwin Report

You can use one of the following methods to generate an ERwin report:

•	Double-click on the report icon ( [image]) in any of the ERwin Report folders in the tree control.

•	Right-click on the report icon ( [image]) in the tree control, then choose Execute ‘<report name>’ from the shortcut menu.

The Report Browser shows the result set generated by the report in the Result Set pane on the right side of the dialog. A result set icon ( [image]) is also added to the tree control under the report icon. By default, the name next to the result set icon is:

<Report Name> (<Time>, <Number of Rows>)

To change the name, right-click on the result set icon and choose the Rename option. The Report Browser lets you edit the result set name.

ERwin reports are editable, that is, you can edit the result set and save the changes back to the .er1 file of the diagram from which the report was generated. In a result set, the pencil icon [image] next to a column heading indicates which column rows are editable. When you click on a cell in an editable column, the cursor changes to a pencil.

If you double-click on a cell while the pencil cursor is displayed, the selected cell and all other editable cells in the highlighted row change to text boxes. You can use standard editing keys, and the Cut, Paste, and Delete options in the Edit menu to edit the text in any of the text boxes.

When you finish editing, you can click the Commit changes button [image] on the Report Browser toolbar. ERwin prompts you to save your changes to the .er1 diagram. Click OK to save the changes, or click Cancel to discard the changes.

After you generate a result set for a report, you can then use the Report Browser’s extensive range of features to further customize the content and change the appearance of the result set. See Customizing a Result Set View  for more information.

You can also display a history of the result sets generated during the current ERwin and ModelMart sessions. See Displaying a History of Result Sets  for more information.

Related Topics

  To generate an ERwin report


To generate an ERwin report

1.	Select the folder that contains the ERwin report you want to generate.

2.	Double-click on the report icon ( [image]) to generate the report. ERwin displays the result set ( [image]) for the report in the Result Set area of the Report Browser window and adds a result set icon under the report in the tree control.

3.	Optionally, edit the result set as follows:

•	Double-click on an editable cell, that is, a cell for which the cursor changes to a pencil when dragged over the cell. All editable cells in the select row change to editable text boxes.

•	Edit the text in the cell.

•	Click the Commit changes button [image] on the Report Browser toolbar. The Update dialog displays prompting you to commit your changes. Click OK to save your changes to the .er1 diagram or click Cancel to cancel your changes.

4.	Optionally, customize the result set. More>


Working with ERwin Report (ERP) Files

During installation, the setup program saves a standard ERwin Reports file (Reports.erp) in the same directory as the ERwin program. This file contains the names and definitions of predefined reports that are supplied with ERwin. An ERwin Reports file contains the following information:

•	The name of each report in the file, which includes a description of where the report is located in the folder hierarchy.

•	The definition of each report, which includes the selected options that define the content and structure of the report.

•	Formatting information for a report, if applicable.

•	Definition text for a report, if applicable.

•	Note text for a report, if applicable.

By default, ERwin saves any customized reports and report folders that you create in the Report Browser in this file as well.

ERwin creates the ERwin Reports list in the Report Browser based on the content of the .erp file. In addition, the Report Browser provides controls on the ERwin Reports menu that let you manage your .erp files. The purpose of each option is explained below:

•	New Report File. Lets you create a new .erp file.

•	Open Report File. Lets you select and open a different .erp file the one that is currently active. If you want to open and run customized reports created by another user, you can click this option and select the user’s .erp file. The user’s reports are then available for you to use.

•	Save Reports File As. Lets you save the active .erp file under a different name.

ERwin displays the name of the active .erp file as an extension to the ERwin Reports folder name in the tree control, for example, ERwin Reports [Myreports.erp]. The name of the active .ERP file is also stored in the [REPORTS] section of the Erwin.ini file. Each time you open the Report Browser, it reads the Erwin.ini file to obtain the last selected ERwin Reports file, then it reads the ERwin Reports file and populates the Report Browser tree control.

When you open a diagram created in an earlier version of ERwin, for example ERwin version 2.6, any named reports stored with the diagram are imported into a new folder called Reports from <diagram name> under the ERwin Reports folder and are automatically included in the ERwin Reports file. See Using Standard ERwin Reports  for more information on the mapping of old ERwin reports to Report Browser reports.

ERwin also keeps a backup copy of the default ERwin Reports file (Reports.erp) called REPORTS.ERK, which you can use to restore the default set of ERwin reports, if necessary.

Related Topics

  To create a new ERwin Reports file

  To open a different ERwin Reports File

  To save ERwin Reports in a new ERwin Reports file


To create a new ERwin Reports file

1.	Choose New Reports File from the ERwin Reports menu. The Report Browser opens the Save As dialog.

2.	Type a name for the new ERwin Reports file.

3.	Click OK. The Report Browser creates a new ERwin Reports file with the .erp extension and makes the new ERwin Reports file the active one. The new file does not contain any ERwin reports.


To open a different ERwin Reports file

1.	Choose Open Reports File from the ERwin Reports menu. The Report Browser displays the Open dialog.

2.	Choose the drive and directory, then select the ERwin Reports file you want to open.

3.	Click OK. The Report Browser makes the file you select the active ERwin Reports file.

Note:	The filename and pathname of the currently selected ERwin Reports file is displayed next to the ERwin Reports folder in the tree control.


To save ERwin Reports in a new ERwin Reports file

1.	Choose Save Reports File As from the ERwin Reports menu. The Report Browser displays the Save As dialog.

2.	Choose a drive and directory, then enter a name for the ERwin Reports file.

3.	Click OK. The Report Browser saves your Reports File with an .erp extension in the directory you selected under the name you assigned and makes it the active one.


Importing Reports from a Diagram Created in an Earlier Version of ERwin

In previous versions of ERwin, any customized reports that were generated for an ERwin diagram were stored with the diagram in the .er1 file. In ERwin version 3.0 or later, when you open a diagram created in an earlier version of ERwin, any customized reports saved with that diagram appear in a new folder called Reports From <Diagram Name> under the ERwin Reports folder. Each customized report retains the name that it was assigned when it was created.

You can modify these reports just like any other ERwin report.

Standard reports contained in previous versions of ERwin are already included in the standard reports provided with ERwin 3.0. See Using Standard ERwin Reports  for more information on the mapping of old ERwin reports to Report Browser reports.

Note:	If you make changes to a report imported from a diagram saved in an earlier version of ERwin, be sure to move the report to a different folder. If you open the older diagram again, you will overwrite the customized ERwin reports in the Reports from <diagram name> folder.

Related Topics

  To import ERwin reports from a diagram created in an earlier version of ERwin


To import ERwin reports from a diagram created in an earlier version of ERwin

1.	Open the diagram created in an earlier version of ERwin.

2.	Open the Report Browser. The tree control shows a new folder called Reports from <diagram name> under the ERwin Reports folder.

The Reports from <diagram name> folder includes all the customized ERwin reports from the diagram that was created in an earlier version of ERwin.

Note:	If you make changes to a report imported from a diagram saved in an earlier version of ERwin, be sure to move the report to a different folder. If you open the older diagram again, you automatically overwrite the customized reports in the Reports from <diagram name> folder with the reports stored in the .er1 file.


Using Shared ERwin Reports

The ModelMart Administrator can promote any ERwin report to the ModelMart where it becomes a report in the Shared ERwin Reports folder. See Creating Shared ERwin Reports for more information.

Any ModelMart user can run a report in any of the folders under the Shared ERwin Reports folder. In addition, any ModelMart user can create a local copy of an report in the Shared ERwin Reports folder. The report is copied from the Shared ERwin Reports folder to the current ERwin Reports folder.

Related Topics

  To create a local copy of a shared ERwin report


To create a local copy of a shared ERwin report

1.	Logon to the ModelMart that contains the shared ERwin report. More>

2.	Click [image].

3.	Click [image] on the Shared ERwin Reports folder and locate the report you want to copy.

4.	Select the report, then choose the Copy Report to File option on the ERwin Reports menu. ERwin copies the selected report to the ERwin Reports folder.


Reporting User-Defined Properties

In the ERwin Report Editor, you can include object UDPs in new or predefined ERwin reports. For objects such as those listed below, you can open the UDP folder and select the [image] Udp check box. See Specifying the Content of an ERwin Report for more information.

You can report UDPs on the following ERwin Objects:

Entities	Tables	Diagrams
Columns	Attributes	Stored Displays
Column Domains	Attribute Domains	Subject Areas
Indexes	Key Groups
Logical Relationships	Physical Relationships
Note:	You can only specify the UDP report option for ERwin objects that you have assigned UDPs.

Related Topics

  To create an ERwin report

  To edit an ERwin Report

  Specifying UDP - Meta Report Options


Specifying UDP - Meta Report Options
Specifying UDP — Meta Report Options

You can use the ERwin Report Editor in the Report Browser to execute a report on UDP meta data information, that is, all UDP definition information in any model object class that can have UDPs. For example, if you generate a list of UDPs for the Attribute object class, the result set would include the UDP name, datatype, default value, and description for all attribute UDPs.

Note: 	You cannot generate recorded UDP values in a UDP — meta report.

Related Topics

  To specify a UDP Meta report

  Reporting User-Defined Properties


To specify a UDP Meta report

1.	Click the [image] button in the toolbar, then double-click on ERwin Report in the New Object dialog.

2.	In the ERwin Report Editor, type a name for your report in the Name box.

3.	Select the Logical button.

4.	Select UDP — Meta in the Category list.

5.	Select the information you want to include in the report from the Options tree control as follows:

•	Click the [image] symbol next to a folder to expand it.

•	Click the [image] symbol next to a folder to collapse it.

•	Select the check box next to the Name, Type, Definition, and Default to include that UDP — meta information in the report.

•	Click the Show Selected Only button to display only the options you have selected for your report and view your selections.

6.	Optionally, click on the Definition tab and type a definition for the report.

7.	Optionally, click on the Note tab and type a note for the report.

8.	Click OK. The Report Browser adds your report to the tree control in the main Report Browser window.

9.	Click [image] to run the report against the active ERwin diagram. More>


Creating a Model Validation Report

You can use the ERwin Report Editor in the Report Browser to define a model validation report that lists inconsistencies or missing information in your database. Using a model validation report can help you to identify problems in your model before you forward engineer a model to a database. For example, you can create a model validation report that lists logical model attributes that have matching names. The Report Editor includes a Model Validation category for both logical and physical model validation reports.

After you create a model validation report, the report name and icon ( [image]) appear in the Model Validation Reports tree control in the Report Browser. You can then use the Report Browser to generate the report just as you would generate any other ERwin report. After you generate a result set for a report, you can use the Report Browser to further customize the content and change the appearance of the result set.

Related Topics

  To create a model validation report

  Summary of Model Validation Report Options

  To generate an ERwin report

  Customizing a Result Set View


To create a model validation report

1.	Click the [image] button in the toolbar, then double-click on ERwin Report in the New Object dialog.

2.	In the ERwin Report Editor, type a name for your model validation report in the Name box.

3.	Select the Logical or Physical button depending on which model you want to validate.

4.	Select Model Validation in the Category list.

5.	Select the information you want to include in the report from the Options tree control as follows:

•	Click the [image] symbol next to a folder to expand it.

•	Click the [image] symbol next to a folder to collapse it.

•	Select the check box next to the Name, FK Name, and Owner to include that information in the report.

•	Click the Show Selected Only button to display only the options you have selected for your report and view your selections.

6.	Optionally, click on the Definition tab and type a definition for the report.

7.	Optionally, click on the Note tab and type a note for the report.

8.	Click OK. The Report Browser adds your report and report icon ( [image]) to the tree control in the main Report Browser window.

9.	Click [image] to run the report against the active ERwin diagram. More>


Summary of Model Validation Report Options

The following table is a summary of Model Validation Report Options for the logical model and the physical model.

Logical Model Validation Option	Physical Model Validation Option
Diagram with no definition	Table with no comment
Entity with no definition	with no columns
with no attributes	with no primary key
with no primary key	with duplicate name
with duplicate name	Column
supertype with only one subtype	with no comment
Attribute	using default datatype
with no definition	with duplicate name in table
with duplicate name in entity	with different foreign key datatype
with different definition	primary key and no-null foreign key columns that allow null
attached to built-in domain	Index
Relationship	with no columns
with no definition	that is redundant
Domain	Relationship
with no definition	with no comment
that is not used	with duplicate name
	with different number of primary key and foreign key columns
	Domain with no comment
	that is not used
Related Topics

  Creating a Model Validation Report

  To create a model validation report


Creating a Slowly Changing Dimension Report

You can use the ERwin Report Editor in the Report Browser to define a table report that lists dimensional modeling roles and dimension type information in your dimensional model. A slowly changing dimension report reports which dimension and outrigger tables are flagged as Fixed (unchanging) or slowly changing Types 1, 2, or 3.

The following options are suggested for a slowly changing dimension report:

After you create a slowly changing dimension report, the report name and icon ( [image]) appear in the Table Reports tree control in the Report Browser. You can then use the Report Browser to generate the report just as you would generate any other ERwin report. After you generate a result set for a report, you can use the Report Browser to further customize the content and change the appearance of the result set.

Note:	The result set of a slowly changing returns a blank dimension type for all fact tables because you cannot flag fact tables as either fixed or slowly changing.

Related Topics

  To create an ERwin report

  To generate an ERwin report

  Customizing a Result Set View

  Accounting for Slowly Changing Dimensions

  To assign a dimension type to a dimension table


Creating a Data Warehouse Rule Report

You can use the ERwin Report Editor in the Report Browser to define a table report that lists data warehouse rules assigned to each table in your dimensional model. Typically, rule definitions document the frequency and timing of data warehouse maintenance. Using the data warehouse rule report, you can report on six types of standard management rules: Refresh, Append, Backup, Recovery, Archiving, and Purge.

The following options are suggested for a data warehouse rule report:

After you create a data warehouse rule report, the report name and icon ( [image]) appear in the Table Reports tree control in the Report Browser. You can then use the Report Browser to generate the report just as you would generate any other ERwin report. After you generate a result set for a report, you can use the Report Browser to further customize the content and change the appearance of the result set.

Related Topics

  To create an ERwin report

  To generate an ERwin report

  Customizing a Result Set View

  Using the Data Warehouse Rule Editor

  To attach a data warehouse rule in the Table Editor


Creating a Data Warehouse Source Report

You can use the ERwin Report Editor in the Report Browser to define a column report that lists data warehouse source assignments for each column in your dimensional model. A data warehouse source report identifies the source for each column in your data warehouse which will help you support regular updates and data quality checks for a data warehouse that combines information from several OLTP systems, as well as archive data, into a single decision support system.

In the data warehouse environment, it is important to track the source of data and the method by which the source data is extracted, transformed, and cleansed before it is imported into the data warehouse. You can define or import the data warehouse source column name, datatype, and comment in the Detail tab of the Data Warehouse Source Editor. Then you can assign the data warehouse source to a column in your model and specify a transform comment in the Data Source tab of the Column Editor or Domain Dictionary Editor.

The following options are suggested for a data warehouse source report:

After you create a data warehouse source report, the report name and icon ( [image]) appear in the Column Reports tree control in the Report Browser. You can then use the Report Browser to generate the report just as you would generate any other ERwin report. After you generate a result set for a report, you can use the Report Browser to further customize the content and change the appearance of the result set.

Related Topics

  To create an ERwin report

  To generate an ERwin report

  Customizing a Result Set View

  Using the Data Warehouse Source Editor

  Specifying Data Warehouse Sources for a Column

  Specifying Data Warehouse Sources Using Domains


ModelMart Administration Overview

As the ModelMart administrator, you are responsible for installing and maintaining the ModelMart. After you install the ModelMart software, you are automatically granted a special security status to add and remove ModelMart users, assign user permissions, and perform all required maintenance tasks. There are two types of administrative tasks that you need to perform:

•	Initial setup tasks to prepare your DBMS environment, install Logic Works ModelMart administrative files, and initialize the ModelMart on your DBMS server.

•	Maintenance tasks necessary to secure your valuable ModelMart data and provide audit information about your ModelMart environment.

•	Manage ModelMart Users. If your workgroup team grows or shrinks, you will need to add or delete users.

•	Manage ModelMart Security. In the ModelMart, security profiles determine who can change the information. By understanding the activities that each member of your workgroup performs, you can assign the necessary privileges and customize permissions to meet the exact needs of your workgroup.

•	Upgrade Your ModelMart License. If your workgroup membership grows, you may need to upgrade your ModelMart license agreement to allow more users to access ModelMart.

•	Upgrade the ModelMart. You may want to upgrade the ModelMart when a new version of the software becomes available. The installation of the administrative files is the same as if you were installing a new ModelMart, but the installation of the ModelMart tables and stored procedures is different depending on your DBMS.

•	Run ModelMart Reports. You can use the Report Browser, a versatile reporting module, to run reports against the ModelMart and customize returned result sets. There are two reporting tasks that can only be performed by the ModelMart administrator; generating Security Manager reports and managing shared ERwin reports.


Initial Setup Tasks

Before your workgroup can use ModelMart to share information, there are several initial tasks that you must perform:

•	Check the system requirements. Check that your systems meet the minimum requirements necessary to install and run ModelMart.

•	Prepare your DBMS environment for ModelMart. Set up your DBMS environment prior to ModelMart installation.

•	Install the Logic Works ModelMart administrative files. Install the files needed to install, initialize, and maintain the ModelMart.

•	Initialize the ModelMart. Create the ModelMart database by installing the required database componentes such as, ModelMart tables and stored procedures.


Checking the System Requirements

Before you install the ModelMart administrative files, make sure that the systems you are using meet the minimum requirements summarized in the chart below. A ModelMart client must be installed on each client workstation and each client must have access to the DBMS on which the ModelMart is installed.

System Component	Administrator’s Workstation or File Server (for administrative files)	Microsoft SQL Server (Version 4.2 or later)	Sybase SQL Server (Version 4.x), System 10, or System 11	Oracle Server (Version 7.2 or later)	INFORMIX Server (Version 7.xx or Version 9.xx)
CPU	486 or better	Any Microsoft SQL Server supported platform	Any Sybase supported platform	Any Oracle supported platform	Any INFORMIX supported platform
RAM	16 MB	32 MB	32 MB	32 MB	128 MB
Disk Space	60 MB	50 MB	50 MB	50 MB	50 MB
Operating System	Microsoft Windows NT (version 3.51 or later), Windows 95, or  Windows (version 3.1x)	Microsoft Windows NT (Version 3.51 or later)	Any Sybase supported operating system	Any Oracle supported operating system	Microsoft Windows NT (Version 3.51 or later)
Note:	In the chart above, the disk space value in the second column is the space required for the ModelMart administrative files that you use to create and manage the ModelMart. To use the data modeling and multiuser features provided by ModelMart, you must also install a ModelMart client. Additional disk space is required to accommodate particularly large models.

Related Topics

  Preparing Your DBMS Environment for ModelMart


Preparing Your DBMS Environment for ModelMart

Before you can install and use ModelMart, you must perform the following setup tasks in your DBMS environment.

•	Install the DBMS. Install your DBMS on the server where you plan to store the ModelMart. Logic Works supports the two most recent versions of each supported DBMS, that is, INFORMIX, Sybase, Microsoft SQL Server, and Oracle. Support for other DBMS versions is also possible. Please contact Logic Works Technical Support for more information. See your DBMS documentation for information about memory and disk space requirements.

•	Create (or identify) the ModelMart database. Use the DBMS features to create or identify the required storage objects and the ModelMart database. The requirements vary depending on your DBMS type. See one of the following topics for more information.

•	Steps that Require the Sybase or SQL Server DBA

•	Steps That Require the Oracle DBA

•	Creating an ODBC Data Source for the ModelMart Database on an INFORMIX Server

Also, see the Logic Works ModelMart RDBMS Tuning Guide for database configuration and tuning information.

•	Create a user profile for each database user. Use the DBMS features to create a user profile for each ModelMart user in the database where the ModelMart is stored. To use the ModelMart, each user must have a valid Login Name on the DBMS and have permission to access the database in which the ModelMart is stored. See your DBMS administrator’s documentation for more information.

•	Install DBMS client software on each client workstation. In order to connect a client workstation to the DBMS server, you must install the appropriate client connection software (for example, SQL*Net) on each workstation. The connection software you use depends on your DBMS type. See Suggested Server Connection Software  for more information.

•	Verify the client/server connection. Use a test command (for example, ping) to check the client/server connection between each client workstation and the DBMS server. Alternatively, use another application on a client workstation (for example, ISQL/W, SQLPLUS, or PowerBuilder) to check the connection. See the documentation provided by your DBMS vendor for more information about testing the client/server connection.

•	Install a ModelMart client on each client workstation. You must use the CD that ships with each ModelMart client (ERwin or BPwin) to install the client software. Then, any user with a ModelMart login and password and the appropriate DBMS client connection software can connect to the ModelMart from that client workstation. Your Logic Works license agreement determines how many users can use the ModelMart. See Understanding Your ModelMart License Agreement  for more information.

Note:	Before BPwin clients can use the ModelMart, after you install the ModelMart, you must install BPwin, then run the BPwin ModelMart Update Manager to upgrade the ModelMart for compatibility with BPwin clients.

Related Topics

  Suggested Server Connection Software


Suggested Server Connection Software

The software you use to connect client workstations to your server depends on the type of server you are using and your personal preference. The following table lists some commonly used DBMS client software connection packages.

If you want to connect to:	You could use:
Microsoft SQL Server 6.0 Microsoft SQL Server 6.5 Sybase System 10 or Sybase System 11	SQL Server 6.x client installation, Open Client/C Developer’s Kit for PC Windows and Net-Library for PC Windows, CT-LIB, or equivalent software
Oracle 7.2 or Oracle 7.3	Oracle "Required Files," SQL*Net, and TCP/IP or equivalent communication software
INFORMIX 7.x or INFORMIX 9.x	INFORMIX-CLI version 2.5 or later.
Note:	To create the ModelMart, you must be the dbo (Sybase or Microsoft SQL Server) or the schema owner (Oracle) of the target database on the server or the INFORMIX DBA.

Related Topics

  Installing the Logic Works ModelMart Administrative Files


Installing the Logic Works ModelMart Administrative Files

For ModelMart client users to access diagrams or models in a Logic Works ModelMart, you must install the Logic Works administrative files on your local machine or file server and the Logic Works ModelMart database on an INFORMIX, Microsoft SQL Server, Oracle, or Sybase DBMS. The installation of the administrative files is the same regardless of the DBMS on which you want to install the ModelMart database.

You use the Setup program on the ModelMart CD to install the Logic Works ModelMart administrative files. The Setup program displays a series of instructions to guide you through the installation. Follow the instructions on your computer.

After the Setup program installs the Logic Works ModelMart administrative files, it displays the Setup Complete dialog.

You have the option of installing and initializing the ModelMart database on the DBMS server.

•	If you do not select the Initialize ModelMart check box and then click the Finish button, the Setup program completes the installation and returns to Windows. You can initialize the ModelMart at a later time using the ModelMart Manager. See Using the ModelMart Manager  for more information.

•	If you select the Initialize ModelMart check box and then click the Finish button, the Setup program completes the installation, then starts Logic Works ModelMart Manager so that you can logon to the DBMS and create a new ModelMart or update an existing ModelMart. The ModelMart initialization is different depending on your DBMS. See Initializing the ModelMart  for more information.

Related Topics

  To install the Logic Works ModelMart Administrative Files

  Logic Works ModelMart Program Group


To install the Logic Works ModelMart Administrative Files

1.	Insert the Logic Works ModelMart CD in your CD-ROM drive.

If you are using a 32-bit operating system and the autorun function for the CD-ROM drive is enabled, the Setup program starts automatically. Follow the instructions on the screen until the Setup Complete dialog is displayed, then go to Step 5. Otherwise, continue with Step 2.

2.	Choose one of the following to open the Run dialog:

•	In Windows 95 or Windows NT version 4, click the Start button, then click Run.

•	In Windows version 3.1x or Windows NT version 3.51, choose Run on the File menu in the Windows Program Manager.

3.	Choose one of the following:

•	For Windows 95 or Windows NT (all versions), type d:\setup in the Run dialog, where d: is your CD-ROM drive.

•	For Windows version 3.1x, type d:\16-bit\setup in the Run dialog, where d: is your CD-ROM drive.

4.	Click OK. The Setup program starts. Follow the instructions on your screen until the Setup Complete dialog is displayed.

5.	Optionally, select the the Initialize ModelMart check box in the Setup Complete dialog, then click the Finish button. See one of the following topics for more information:

•	To initialize the ModelMart on a Microsoft SQL Server or Sybase DBMS

•	To initialize the ModelMart on an Oracle DBMS

•	To initialize the ModelMart on an INFORMIX Server

Note:	The Setup program installs Logic Works administrative files in the directory that you specify during installation.

For Windows 95 and Windows NT (all versions), the default installation directory is C:\Program Files\Logic Works\ModelMart 3.0.

For Windows version 3.1x, the default installation directory is C:\Lw3mm.


Logic Works ModelMart Program Group

The Setup program creates the Logic Works ModelMart program group. The purpose of each icon in the program group is explained below:

•	Logic Works ModelMart Manager. Use this icon to access the ModelMart Manager dialog which lets you perform administrative tasks such as initializing the ModelMart.

•	Readme File. Contains important information about installing and using Logic Works ModelMart.

•	ModelMart Synchronizer. Starts the ModelMart Synchronizer, an independent application that you can use to synchronize ERwin data models and BPwin business process models in ModelMart.

•	RPTwin. Start RPTwin, the Logic Works reporting tool.

•	Acrobat Reader 3.0 Installer. Use this icon to install Adobe Acrobat Reader version 3.0 on your system. The Acrobat Reader is necessary to read the online documentation provided in PDF format.

•	Logic Works ModelMart Administrator’s Guide. Use this icon to open the PDF version of the Logic Works ModelMart Administrator’s Guide.

•	RDBMS Tuning Guide. Use this icon to open a PDF version of the Logic Works ModelMart RDBMS Tuning Guide.

•	RPTwin User’s Guide. Use this icon to open a PDF version of the RPTwin User’s Guide.

•	ERWINFAQ.WRI. Use this icon to open the ERwin FAQ document which provides the answers to the most frequently asked questions about ERwin.

•	Uninstall Logic Works ModelMart Manager. Use this icon to remove all Logic Works ModelMart administrative files from your computer. See Uninstalling Logic Works ModelMart Administrative Files  for more information.

Related Topics

  Initializing the ModelMart


Initializing the ModelMart

You use the ModelMart Manager to install the ModelMart objects such as, tables and stored procedures, in the ModelMart database. You can start the ModelMart Manager in one of two ways:

•	Select the Initialize ModelMart check box in the Setup Complete dialog when installing or upgrading the ModelMart administrative files. See Installing the ModelMart Administration Files  or Upgrading the ModelMart  for more information.

•	Click the ModelMart Manager icon in the Logic Works ModelMart Manager program group. See Using the ModelMart Manager  for more information.

When you start the ModelMart Manager, the ModelMart Connection Manager dialog is displayed so that you can log on to the DBMS that contains the ModelMart.

The information that you must enter to log on to the DBMS and install the ModelMart objects in the ModelMart database depends on the DBMS type you are using. Please refer to one of the following for more information:

•	To initialize the ModelMart on a Microsoft SQL Server or Sybase DBMS

•	To initialize the ModelMart on an Oracle DBMS

•	To initialize the ModelMart on an INFORMIX Server

After you initialize the ModelMart, the ModelMart Security Manager is displayed so that you can create new ModelMart users and assign their security permissions. See Using ModelMart Security Features  for more information.


To initialize the ModelMart on a Microsoft SQL Server or Sybase DBMS

1.	Choose one of the following to start the Logic Works ModelMart Manager:

•	During installation of the ModelMart administrative files, select the Initialize ModelMart check box in the Setup Complete dialog, then click the Finish button.

•	After installation, in Windows 95 or Windows NT version 4.0, click Start, Programs, Logic Works ModelMart Manager (program group), Logic Works ModelMart Manager (icon).

•	After installation, in Windows version 3.1x or Windows NT version 3.51, open the Logic Works ModelMart Manager program group, then double-click the Logic Works ModelMart Manager icon.

2.	Type the login name and password for the dbo of of the ModelMart database, then click the Advanced button to expand the dialog.

3.	Select or type the following information:

•	Select your DBMS version and connection library (for example, SQL Server Vers. 6 - using db-lib) in the Host DBMS box.

•	Enter the server name (for example, sql6) in the DBMS Connection box.

•	Leave the ModelMart Master Database box blank.

4.	Click OK. The Select ModelMart Master Database dialog is displayed.

5.	Select the database in which you want to store the ModelMart Control Tables in the Database box in the Select ModelMart Master Database dialog.

6.	Click OK. The ModelMart Control Tables are created in the database you select, then the ModelMart Manager dialog is displayed.

7.	Select the database in which to store the ModelMart in the Database box in the ModelMart Manager dialog.

8.	Click OK. The ModelMart is created in the database you select, then the ModelMart Security Manager is displayed.

9.	The first time you initialize the ModelMart, drag your user name from the User list and drop it on the Administrator profile in the Security Profile list.

10.	Optionally, use the controls in the ModelMart Security Manager dialog to add and remove other ModelMart users and assign security profiles. See Creating ModelMart Users  for more information.

11.	When you finish working in the ModelMart Security Manager dialog, click OK. The Setup Complete message is displayed.

12.	Click OK to return to Windows.

Note:	In Step 3, if you have already entered this information, you can choose the connection information from the History list to automatically populate the Host DBMS and DBMS Connection boxes.

You can create the ModelMart in the same database in which you installed the ModelMart Control Tables or in a different database, but the ModelMart and the ModelMart Control Tables must be installed on the same DBMS.


To initialize the ModelMart on an Oracle DBMS

1.	Choose one of the following to start the Logic Works ModelMart Manager:

•	During installation of the ModelMart administrative files, select the Initialize ModelMart check box in the Setup Complete dialog, then click the Finish button.

•	After installation, in Windows 95 or Windows NT version 4.0, click Start, Programs, Logic Works ModelMart Manager (program group), Logic Works ModelMart Manager (icon).

•	After installation, in Windows version 3.1x or Windows NT version 3.51, open the Logic Works ModelMart Manager program group, then double-click the Logic Works ModelMart Manager icon.

2.	Type the login name and password for the schema owner of of the ModelMart database, then click the Advanced button to expand the dialog.

3.	Select or type the following information:

•	Select your DBMS version (for example, Oracle Vers. 7.3) in the Host DBMS box.

•	Type your connection string (for example, mm.world) in the DBMS Connection box.

4.	Click OK. The ModelMart Manager dialog is displayed.

5.	Select the Oracle security role created for ModelMart users (typically named MMUSER) in the ModelMart Role box. See Steps that Require the Oracle DBA  for more information.

6.	Select the Oracle tablespace in which you want to store the ModelMart tables in the Table Tablespace box. Optionally, select the Oracle tablespace in which you want to store ModelMart indexes in the Index Tablespace.

7.	Click Create to continue. The ModelMart objects are automatically created, then the ModelMart Security Manager dialog is displayed.

8.	If you are initializing the ModelMart for the first time, drag your user name from the User list and drop it on the Administrator profile in the Security Profile list.

9.	Optionally, use the controls in the ModelMart Security Manager dialog to add and remove other ModelMart users and assign security profiles. See Creating ModelMart Users  for more information.

10.	When you finish working in the ModelMart Security Manager dialog, click OK. The Setup Complete message displays.

11.	Click OK to return to Windows.

Note:	In Step 3, if you have already entered this information, you can choose the connection information from the History list to automatically populate the Host DBMS and DBMS Connection boxes.

In Step 6, you can choose to store ModelMart tables and indexes in the same tablespace or in different tablespaces.


To initialize the ModelMart on an INFORMIX Server

1.	Choose one of the following to start the Logic Works ModelMart Manager:

•	During installation of the ModelMart administrative files, select the Initialize ModelMart check box in the Setup Complete dialog, then click the Finish button.

•	After installation, in Windows 95 or Windows NT version 4.0, click Start, Programs, Logic Works ModelMart Manager (program group), Logic Works ModelMart Manager (icon).

•	After installation, in Windows version 3.1x or Windows NT version 3.51, open the Logic Works ModelMart Manager program group, then double-click the Logic Works ModelMart Manager icon.

2.	Type the login name and password for the INFORMIX DBA, then click the Advanced button to expand the dialog.

3.	Select and type the following information:

•	Select your DBMS version (for example, Informix Vers. 7/9.xx) in the Host DBMS box.

•	Type the name of the ODBC data source that lets you access the INFORMIX database in which you want to install ModelMart (for example, informix911) in the DBMS Connection box.

4.	Click OK. The ModelMart Manager dialog is displayed.

5.	Click Create to continue. The ModelMart objects are automatically created, then the ModelMart Security Manager dialog is displayed.

6.	If you are initializing the ModelMart for the first time, drag your user name from the User list and drop it on the Administrator profile in the Security Profile list.

7.	Optionally, use the controls in the ModelMart Security Manager dialog to add and remove other ModelMart users and assign security profiles. See Creating ModelMart Users  for more information.

8.	When you finish working in the ModelMart Security Manager dialog, click OK. The Setup Complete message is displayed.

9.	Click OK to return to Windows.

Note:	You must create the ModelMart in the database referenced by the ODBC data source you specified when you logged on.


Understanding Your ModelMart License Agreement

When you install Logic Works ModelMart, you type a special ModelMart license key that determines the maximum number of authorized ModelMart users that your installation supports. Read the special "Before You Install" card that comes with Logic Works ModelMart for information on how to obtain your ModelMart license key from Logic Works Customer Support.

As part of the administrative process, you must assign a login name to each ModelMart user. When a user types a login name to connect to ModelMart, the ModelMart License Manager checks that the login name is valid and verifies that the maximum number of users will not be exceeded. If the maximum number of users allowed by your ModelMart license is exceeded, an error message is displayed.

If you want to add additional ModelMart users, but you have already assigned user names equal to the maximum number allowed by your ModelMart license agreement, you must either:

•	Upgrade your ModelMart license. See Upgrading Your ModelMart License  for more information.

•	Remove one of the existing ModelMart users and add the new ModelMart user. See Creating ModelMart Users  for more information.

•	Purchase a Navigator edition of your ModelMart client for those users who need read-only access to ModelMart. You can use the Navigator edition to open and print a diagram or model and generate reports, but you cannot save changes to the ModelMart or save to a file. You can use the ModelMart security feature to assign Navigator users to a special security profile which has read-only permissions and is not counted toward your license agreement. See Using Security to Manage Your License Agreement  for more information.

Related Topics

  Upgrading Your ModelMart License


Uninstalling Logic Works ModelMart Administrative Files

When you install Logic Works ModelMart, the Setup program creates an Uninstall Logic Works ModelMart Manager icon in the Logic Works ModelMart Manager program folder. When you double-click the Uninstall Logic Works ModelMart Manager icon, the Uninstall program prompts you to confirm that you want to remove Logic Works ModelMart administrative files from your computer. You can choose one of the following options:

•	Click No. The Uninstall program terminates without deleting any Logic Works ModelMart administrative files.

•	Click Yes. The Uninstall program opens the Remove Programs from Your Computer dialog, automatically deletes the Logic Works ModelMart administrative files, and informs you that the uninstall completed. Click OK.

Related Topics

  To uninstall the Logic Works ModelMart Administrative Files


To uninstall the Logic Works ModelMart Administrative files

1.	Choose one of the following to start the Uninstall Logic Works ModelMart Manager program:

•	In Windows 95 or Windows NT version 4.0, click Start, click Programs, click Logic Works ModelMart Manager, then click Uninstall Logic Works ModelMart Manager.

•	In Windows version 3.1x or Windows NT version 3.51, open the Program Manager, double-click on the Logic Works ModelMart Manager program group, then double-click the Uninstall Logic Works ModelMart Manager icon.

A message prompts you to confirm that you want to remove Logic Works ModelMart administrative files from your computer.

2.	Click OK. The Uninstall program removes the administrative files from your computer and informs you that the uninstall is complete.


ModelMart Oracle Database Objects

The installation of ModelMart on an Oracle database management system creates the following database objects:

•	Tables

•	Indexes

•	Sequences

•	Stored Procedures

•	Public Synonyms


Steps That Require the Oracle DBA

You must perform the following steps in order to install ModelMart on an Oracle database management system. These steps may be performed using graphical tools but you can also use SQL *Plus (all versions), SQL*DBA (either command line or full screen mode), or the Oracle Server Manager that ships with Oracle version 7.2 or later. Examples of SQL commands are included where appropriate. Data file paths, data file sizes, role names, and user names are included for example only.

1.	Check SYSTEM tablespace. The ModelMart installation creates several stored procedures. All triggers, stored procedures, and packages are kept in the Oracle SYSTEM tablespace. The standard size of the SYSTEM tablespace assumes that you are NOT using procedural options; so the SYSTEM tablespace will often need to be expanded. If other Oracle applications are not using procedural code, then the SYSTEM tablespace should be expanded to 16 MB. If other Oracle applications also use procedural code, expand the SYSTEM tablespace to 32 MB or greater.

2.	Check Rollback Segment tablespace. ModelMart requires significant rollback space for installation and use. The rollback segments should be in their own tablespace and have at least 16 MB of available space. Also, there should be one rollback segment for every 4 concurrent users, up to a maximum of 50 rollback segments. The available space should scale upward with increasing numbers of rollback segments. Finally, the rollback segment optimal parameter should probably be set to control rollback segment growth and space consumption. See Chapter 1, Oracle Tuning Recommendations, in the Logic Works ModelMart RDBMS Tuning Guide for more information.

3.	Run the CATPROC.SQL script. The CATPROC.SQL must be run while connected as SYS or INTERNAL. This script configures the database for the procedural option (for example, triggers, stored procedures, and packages). ModelMart will not function if you do not perform this step.

4.	Create a ModelMart data tablespace. For example:

CREATE TABLESPACE ModelMart
DATAFILE ‘/db01/oracle/rdbms73/data/modelmart.ora’ SIZE 100M;

5.	Create a ModelMart index tablespace. For example:

CREATE TABLESPACE MMARTINDEX
DATAFILE ‘/db02/oracle/rdbms73/data/mmartindex.ora’ SIZE 75M;

6.	Create a ModelMart temporary tablespace. For example:

CREATE TABLESPACE MMTEMP
DATAFILE ‘/db03/oracle/rdbms73/data/mmarttemp.ora’ SIZE 50M;

7.	Create an Oracle user to be used by the ModelMart Installer. Assign the ModelMart data tablespace as this user’s default tablespace, and the ModelMart temporary tablespace as this user’s temporary tablespace. For example:

CREATE USER STEVE IDENTIFIED BY STEVE
DEFAULT TABLESPACE ModelMart
TEMPORARY TABLESPACE MMTEMP
QUOTA UNLIMITED ON ModelMart
QUOTA UNLIMITED ON MMARTINDEX;

8.	Create a ModelMart Installer role. For example:

CREATE ROLE MMINSTALL;

This is the role required by the Oracle user installing ModelMart.

9.	Grant Oracle privileges to the ModelMart Installer role. For example:

grant create sequence to MMINSTALL;
grant create table to MMINSTALL;
grant create view to MMINSTALL;
grant drop public synonym to MMINSTALL;
grant create public synonym to MMINSTALL;
grant create procedure to MMINSTALL;

grant select on dba_roles to MMINSTALL;
grant select on dba_tablespaces to MMINSTALL;
grant select on dba_free_space to MMINSTALL;
grant select on dba_indexes to MMINSTALL;
These are the Oracle privileges that the ModelMart Installer needs to install the ModelMart on Oracle. To grant the last three privileges in the list above, you must be connected to Oracle from a SYS privileged account.

10.	Create a ModelMart User role. For example:

CREATE ROLE MMUSER;

During installation, when you select this role as the ModelMart user role, the Setup program generates grant statements that grant ModelMart object level privileges to this role.

11.	Grant the create session Oracle privilege to the ModelMart User role. For example:

grant create session to MMUSER;

The create session privilege is the only privilege that an Oracle user requires to use the ModelMart.

12.	Grant the ModelMart User role to each Oracle user that will be using ModelMart. For example:

grant MMUSER to USER1;

grant MMUSER to USER2;

grant MMUSER to USER3;

.

.

.

13.	Grant the ModelMart User role to the ModelMart Installer role. For example:

grant MMUSER to MMINSTALL;

14.	Grant the ModelMart Installer role to the ModelMart Installer user. For example:

grant MMINSTALL to STEVE;

15.	Run the ModelMart setup program. When the setup is complete, choose the Initialize ModelMart option, and connect to Oracle as the ModelMart Installer user (for example, STEVE).

16.	Select the ModelMart tablespaces and ModelMart User role. When prompted for tablespace and role information, choose the ModelMart data tablespace, the ModelMart index tablespace, and the ModelMart User role, that is, the Oracle role created in Step 10.

17.	Add the ModelMart Installer user as the ModelMart administrator. When the ModelMart Security Manager is opened, drag the ModelMart Installer User icon to the ModelMart administrator security profile. This completes the setup and you can begin using the ModelMart.

Note:	After successful installation, you can revoke the ModelMart Installer role and grant the ModelMart User role to the ModelMart Installer user.


Oracle Connections

ModelMart uses Oracle SQL*Net for client access to the database server. SQL*Net is Oracle’s remote data access messaging software. ORACLE recommends that users install only SQL*Net edition 2.x. Connectivity support for version 1.x is being discontinued. SQL*Net supports the following network protocols:

•	Named pipes. Usually, Oracle running under Windows NT or UNIX.

•	TCP/IP. Usually, Oracle running under Windows NT or UNIX.

•	IPX/SPX. (Novell’s protocol) Oracle is expecting network packets in the IPX/SPX format. Oracle can be running under Windows NT or on a Novell Netware Server.

Although Oracle provides two utilities for defining your network, clients, and server (SQL*Net Configuration tool and Network Manager tool), a network administrator will be necessary. Often, the server system administrator is the best candidate for this task.

SQL*Net requires certain files on both the server and client machines. These files can be generated by the Oracle networking tools, but can also be created via a text editor. Since Oracle will not support those sites that generate these files manually, it is better to use the appropriate Oracle utilities. The best source of information about these utilities is Oracle’s SQL*Net Administrator’s Guide. The required files are:

File Name	Required on	File Contents
TNSNAMES.ORA	Client & Server	A list of service names and connect descriptors for network destinations (tells client where it can make connections)
TNSNAV.ORA	Client & Server	A list of communities in which client is a member
SQLNET.ORA	Client & Server	A list of optional diagnostic parameters
LISTENER.ORA	Server only	A list of names and addresses of all listeners on a machine and the Oracle SID’s for the databases known on that machine
Note:	If you are using the 16-bit edition of ERwin, you must also use the 16-bit editions of the database connectivity products listed in this appendix. Similarly, you must use 32-bit connectivity software with a 32-bit edition of ERwin.


Some Useful Oracle SQL Commands

If a graphical DBMS access tool is not available, you can use Oracle SQL commands via SQL*DBA or SQL*Plus. Use the following examples to help you create a tablespace, create a rollback segment, and create a user. See the Oracle SQL Language Reference Manual for additional help.

Related Topics

  To create a tablespace

  To create a rollback segment

  To create Oracle Users

  To grant privileges to users


To create a tablespace

To create a tablespace, use the CREATE TABLESPACE command:

CREATE TABLESPACE mm_data	/* The tablespace name. */
DATAFILE 'C:\ORANT\DATABASE\mmdata.dat'	/* The data file name. */
SIZE integer_value K or M or G	/* The data file size */
DEFAULT STORAGE (	/* The default storage parameters */
    INITIAL integer_value K or M or G	/* The initial extent size */
    NEXT integer_value K or M or G	/* The next extent size */
    PCTINCREASE integer_value	/* The percent to grow extents */
    MINEXTENTS integer_value	/* The minimum number of extents */
    MAXEXTENTS integer_value	/* The maximum number of extents */
) ;


To create a rollback segment

To create a rollback segment, use the CREATE ROLLBACK SEGMENT command:

CREATE PUBLIC ROLLBACK SEGMENT mm_rbs_1	/* The rollback segment name */
TABLESPACE mm_rbs	/* the tablespace name for the RBS */
STORAGE (	/* The storage parameters for the RBS */
    INITIAL integer_value K or M or G	/* The initial extent size */
    NEXT integer_value K or M or G	/* The next extent size */
    PCTINCREASE integer_value	/* The percent to grow extents */
    MINEXTENTS integer_value	/* The minimum number of extents */
    MAXEXTENTS integer_value	/* The maximum number of extents */
OPTIMAL integer_value K or M or G	/* the optimal size for the RBS */
);


To create Oracle Users

To create a user, use the CREATE USER command:

CREATE USER mm_user_1	/* The user id name */
IDENIFIED BY password	/* The user password */
DEAFULT TABLESPACE tablespace_name	/* The user’s default tablespace */
TEMPORARY TABLESPACE tablespace_name	/* The user’s temporary tablespace */
QUOTA unlimited_or_integer_K_M_G ON tablespace_name	/* The user’s quota on a tablesapce */
;


To grant privileges to users

To grant a user privileges, use the GRANT command:

GRANT role_or_privilege_name
TO user_or_role
;


Troubleshooting Problems with an Oracle Installation

The following chart provides help for solving minor problems that may occur during installation.

Problem	Recommended Solution
ModelMart fails to connect to Oracle.	1. Check that you have supplied correct Oracle User ID and password. 2. Check that you have supplied correct SQL*Net connect string. 3. PING server to verify that network connectivity is functioning. 4. Check that client TNSNAMES.ORA file is current and correct. 5. Verify that SQL*Net Listener is currently running on the server.
You are unable to create the ModelMart during an initial install.	Rerun the ERwin installation program, but clear all of the ERwin Installation Options in the ERwin Installation dialog.
You receive a message that the tablespace is full (that is, unable to allocate extents).	Use a DBMS utility (for example, Server Manager) and type the appropriate command to either add another datafile to the tablespace or extend the current datafile (Oracle version 7.2).
You receive a message that the rollback segment has reached maximum number of extents.	Use a DBMS utility (for example, Server Manager) and alter the rollback segment to use both larger initial and next extents, and possibly increase the pctincrease parameter as well.
You need to upgrade your ModelMart software to a newer version.	If you are upgrading to a new ModelMart version, open the ModelMart Manager and click the Update button in the ModelMart Manager dialog to update the ModelMart tables and stored procedures without overwriting your existing data.


		erw_Action
		erw_Attribute
		erw_Class
		erw_Color
		erw_Created
		erw_Deleted
		erw_Domain
		erw_Editor_Control_Function
		erw_Font
		erw_Index_Member
		erw_License
		erw_Lock_Type
		erw_Master
		erw_Object_Feature
		erw_Permission
		erw_Physical_DataType
		erw_Physical_Property
		erw_Query
		erw_RI_Rule
		erw_Subject_Area
		erw_Synonym
		erw_Trace
		erw_Work
		idw_Physical_Property


			erw_att_group_delete
			erw_attr_cascade_delete
			erw_bitmap_dependencies
			erw_column_create
			erw_diagram_create
			erw_diagram_post_load
			erw_domain_dependencies
			erw_entity_cascade_delete
			erw_font_create
			erw_global_domain_create
			erw_index_delete
			erw_library_create
			erw_license_update
			erw_message_log
			erw_object_create
			erw_object_feature_clear
			erw_object_lock
			erw_object_open
			erw_object_prof_assign_clear
			erw_object_text_prop_get
			erw_permission_clear
			erw_permission_update
			erw_physical_obj_create
			erw_property_create
			erw_relationship_create
			erw_report_delete
			erw_repository_create
			erw_repository_trace_status
			erw_session_end
			erw_stored_display_copy
			erw_subject_area_create
			erw_subject_area_is_duplicate
			erw_synonym_create
			erw_table_cascade_delete
			erw_text_block_create
			erw_udp_def_create
			erw_upd_indp_atts
			erw_verify_auto_archive
			erwi_archive_att_group
			erwi_archive_diagram
			erwi_archive_index


			erwi_archive_object
			erwi_archive_phys_obj
			erwi_archive_stored_display
			erwi_archive_table
			erwi_att_group_delete
			erwi_attribute_delete
			erwi_check_edit_lock
			erwi_column_create
			erwi_delete_attributes
			erwi_delete_domains
			erwi_delete_indices
			erwi_delete_props
			erwi_delete_subject_areas
			erwi_delete_text_blocks
			erwi_domain_create
			erwi_dwx_dependencies
			erwi_entity_delete
			erwi_force_sys_table_reload
			erwi_get_design_lock
			erwi_get_udp_id
			erwi_increment_object_versions
			erwi_index_member_create
			erwi_library_delete
			erwi_non_version_trace
			erwi_object_create
			erwi_object_fast_lock
			erwi_object_lock
			erwi_physical_obj_dependencies
			erwi_relationship_delete
			erwi_session_get_id
			erwi_subject_area_create
			erwi_synonym_create
			erwi_table_delete
			erwi_trace
			erwi_update_links
			erwi_update_sa_rel_vers
			erwii_object_create


Steps that Require the Sybase or SQL Server DBA

The following steps must be performed in order to install ModelMart on Sybase or Microsoft SQL Server database management systems:

1.	Create devices. For optimum performance, ensure that separate devices are used to store the ModelMart data and the transaction log.

The size of the data device you create determines the size of the database. For ModelMart, the minimum database size is 16 MB so there has to be at least one device that is 16 MB. You should also locate the data device on a different disk (and disk controller) than the transaction log.

For example, you can increase performance by creating a 50 MB data device and a 25 MB log device. A minimum of 40 MB of disk space (data and log) is required.

To create the devices, you can use a graphical user interface (GUI) tool, ISQL (all versions), SQL Administrator, or Enterprise Manager. If a GUI tool is not available, you can use ISQL to type in the appropriate commands manually. Some examples of command statements are included at the end of this appendix.

2.	Create a database. Create a database that uses the devices created in Step 1. This database will contain the ModelMart. If you use any of the tools mentioned above, you will be prompted for the device(s) to be used for the database. The newly created database is “owned” by the user that created it. Normally, only the login known as ‘sa’, usually the DBA, is granted permission to create databases.

3.	Add users. In order for ModelMart users to access the database, you must either add existing logins as users to the database or create new logins and add them as users of the database. On both Sybase and Microsoft SQL Server, a login is an entity allowed to connect to the database server; a user gives a login the right to use a particular database.

4.	Check the Stored Procedure Cache. The ModelMart installation creates in excess of 150 stored procedures. The ModelMart client invokes these stored procedures to affect changes to the ModelMart. Set the Stored Procedure Cache size to at least 8 MB. Setting it higher will improve performance, especially when many users are accessing the server concurrently. Setting it lower will result in fatal errors and rollbacks when the Stored Procedure Cache size is exceeded.

5.	Check the Log Segment/Device Size. For best performance, ensure that separate devices are used to store the ModelMart data and the transaction log. Set the log space to at least 32 MB. Setting it lower will result in slower execution, fatal errors, and rollbacks when the log space is exceeded. Set the “Truncate Log on Checkpoint” option, and have the server generate checkpoints frequently. By selecting this option, the log is emptied periodically and should not fill up and cause rollbacks.

6.	Check tempdb Size. ModelMart requires significant temporary space for installation and use. The temporary segments should be in their own tablespace and have at least 16 MB of available space. You should also increase available space as the number of concurrent users increases.

7.	Check memory allocated to the database server. Allocate at least 32 MB of RAM to the database server. The amount of RAM allocated should be half of the available RAM on the server machine.

Once these steps have been completed, you can run the Administrative Setup program located on the ModelMart CD-ROM.

Note:	Do not attempt to run the ModelMart setup program unless you are certain that the computer you are using can connect to the target server. Refer to SQL Server Connections  or Sybase Connections  for tips on how to determine if your installation computer can connect to the target server.

When you install ModelMart, it is also imperative that your user id is the database owner for the ModelMart database(s). See To create logins using Transact SQL  for more information about changing database owners.

The Setup program prompts you for a ModelMart installation directory. By default this directory is C:\LW21MM, but you can change the path to a directory that is accessible to all ModelMart client computers.

Note:	Do not use the default directory unless this is to be a single-user installation or the default directory is visible to all potential ModelMart users.


SQL Server Connections

An ERwin client can use a number of different methods to connect to a ModelMart hosted on a SQL Server DBMS. The most common methods of connection use DBLIB and NETLIB.

Related Topics

  DBLIB

  NETLIB

  SQL Server Client Configuration


DBLIB

Microsoft SQL Server uses a combination of a group of DLLs called Net-Library and a group of DLLs named DB-Library to connect to the database.

The 16-bit ModelMart setup looks for the primary DB-Library DLL called w3dblib.dll (4.21, 6.0) or msdblib3.dll (6.5). These files are members of the DB-Library, and the combination of the DB-Library and the Net-Library are commonly referred to as simply DB-Library. The 32-bit ModelMart setup looks for the primary DLL called ntwdblib.dll.

The default installation directory for SQL Server connectivity is \sql60 for SQL Server 6.0 and \mssql for SQL Server 6.5. The 16-bit connectivity files are stored in a subdirectory called \bin, and the 32-bit files are stored in a subdirectory called \binn. Microsoft SQL Server installation also puts copies of the msdblib3.dll, w3dblib.dll, and/or ntwdblin.dll DLLs in the <system_directory>\system directory.

Note: 	For Microsoft SQL Server 4.21 and 6.0, the 32-bit files are stored in the \dll subdirectory.

The installation file structure for Microsoft SQL Server that must be in the path is: <drive and directory>\bin for 16-bit software, and <drive and directory>\binn for 32-bit software.

For example:

c:\mssql\bin;c:\mssql\binn

You can make sure that this path is correct by typing the path command at the DOS prompt.


NETLIB

The primary DLL that ModelMart calls is a member of the DB-Library group. This file, in turn, calls the appropriate Net-Lib DLL for the protocol that you have specified.

You can use the Client Configuration Utility to specify the protocol-specific Net-Lib DLL. For 16-bit software, this utility is in the SQL Server Tools program group. For 32-bit software, this utility is in the Microsoft SQL Server 6.x program group. See SQL Server Client Configuration  for more information.

NETLIB is the network transport/protocol-specific DLL that DBLIB calls. To use NETLIB, you must know what type of protocol is available on your system or network to access Microsoft SQL Server. A network administrator may be necessary here. The choices are:

•	Named pipes. Usually, Microsoft SQL Server running under Windows NT.

•	TCP/IP via Windows Sockets. Can be used for Microsoft SQL Server running under Windows NT.

•	IPX/SPX. SQL Server can be running on a Novell Netware Server.

Either TCP/IP or named pipes is the most common choice for Microsoft SQL Server under Windows NT.

The following table shows the Net-Library DLLs that a SQL Server client uses for 32-bit software (in the Windows NT/ 95 column) and 16-bit software (in the Windows column):

Net-Library	Windows NT / 95 (32-Bit)	Windows (16-Bit)
Named Pipes	DBNMPNTW.DLL	DBNMP3.DLL
TCP/IP Sockets	DBMSSOCN.DLL	DBMSSOC3.DLL
Multi-Protocol	DBMSRPCN.DLL	DBMSRPC3.DLL
IPX/SPX	DBMSSPXN.DLL	DBMSSPX3.DLL
Banyan VINES	DBMSVINN.DLL	DBMSVIN3.DLL
Note:	For TCP/IP, the NETLIB DLL used may depend on the specific edition of TCP/IP.


SQL Server Client Configuration

To specify the DLL for the protocol available on your system, you can use the Client Configuration Utilities mentioned earlier. Using these utilities, you can view the DB-Library and view or edit the Net-Library information for the current configuration.

The first tab shows you information about the DB-Library DLL, the version, the filename, the date and size. The second tab shows you the same information for the Net-Library being used.

The third tab is the Advanced section. This is where you set up aliases. An alias reflects the value a user must type in the Server section of the ModelMart Connection dialog.

The information that you type using these utilities is recorded in the system INI file or the system registry. For a 16-bit client, the entries are recorded in the WIN.INI file under a section called [sqlserver]. This WIN.INI file is located in the system directory. For a 32-bit client, the entries are recorded in the NT Registry, in the Hkey_Local_Machine\Software\Microsoft\MSSQLServer\Client\ConnectTo area.

For a 16-bit client, you can edit the WIN.INI file directly as an alternative to using the Client Configuration Utility. However, for a 32-bit client, you must always use the Client Configuration Utility to maintain the integrity of the Windows 95 or Windows NT registry.


Sybase Connections

With the introduction of Open Client System 10, Sybase added the CT-Library method of connectivity and made modifications to the DB-Library. When used with System 10, DB-Library is essentially a compatibility layer for applications that had been written earlier. This compatibility layer includes the physically smaller w3dblib.dll that is installed with Open Client System 10.

Note:	DB-Library and CT-Library are one install with Open Client System 10.

The primary DLL for the 16-bit CT-Library is wctlib.dll and for the 16-bit DB-Library is w3dblib.dll. These DLLs call the appropriate System 10 Net-Lib DLL for the protocol you specified. Both DB-Library and CT-Library use the same Net-Lib. For 32-bit software, the primary DLL for DB-Library is libsybdb.dll and the primary DLL for CT-Library is libct.dll.

Both the 16-bit and 32-bit software are installed to the same directory structure with Sybase. In this installation, the \bin subdirectory contains the executables for the utilities and batch files for both 16-bit and 32-bit software. The \dll subdirectory holds the DLLs for both 16-bit and 32-bit software. The path for Sybase installations should be:

<drive and directory>\bin ; <drive and directory>\dll

For example:

c:\sybase\bin;c:\sybase\dll

Related Topics

  NETLIB

  Sybase Client Configuration


NETLIB

For both DB-Library and CT-Library, the specification for the Net-Library protocol is contained in a file called the SQL.INI (rather than the WIN.INI) which is located in the Sybase installation directory structure in the \ini subdirectory.

You can use the SQLEdit configuration utility supplied with Sybase to configure the SQL.INI file. This file configures the various aliases for both the 16-bit and 32-bit software for CT-Library that you want to use to provide Sybase with the connection information. See Sybase Client Configuration  for more information on Sybase alias organization and a description of the differences from the Microsoft SQL Server alias organization.

The following table shows the Net-Library DLLs that a Sybase client uses for 32-bit and 16-bitbit connectivity.

Net-Library	Windows NT / 95 (32-Bit)	Windows (16-Bit)
Named Pipes	NLMSNMP.DLL	WNLNMP.DLL
(Winsock) TCP/IP Sockets	NLWNSCK.DLL	WNLWNSCK.DLL
IPX/SPX	NLNWLINK.DLL	WNLNOVSP.DLL
DecNET	NLDECNET.DLL	WNLDECPW.DLL


Sybase Client Configuration

An alias is a word used to replace other, more extensive information. An alias is always “resolved” somewhere else. To resolve an alias means that the software using the alias references that other place to get the complete information. Aliases are organized a little differently using Sybase CT-Library than they are using Microsoft SQL Server. You can view alias definitions using either the SQLEdit utility (the Sybase Client Configuration Utility for CT-Library) or by opening the SQL.INI file in any text editor.

The following are some examples from a SQL.INI file. In these examples, the alias is referenced by both the 16-bit and the 32-bit CT-Library software. The entry “query” is the 32-bit software’s resolution, and the “win3_query” resolves the 16-bit software’s part of the alias. The names “sneakers” and “mucklucs” are examples of host computer names on which Sybase is installed. These names should resolve to a TCP/IP address in the “Hosts” file found on your local system.

The following example simply set up a connection to Sybase on the Sneakers host machine listening on socket 2025 with both the 16-bit and 32-bit software. SYBASE10 is the alias that you would type into the Server Name field in the ModelMart Connection dialog.

[SYBASE10]
query=NLWNSCK,sneakers,2025
win3_query=WNLWNSCK,sneakers,2025

The following example points to this same installation of Sybase. However, when using the 32-bit software, the connection is by Named Pipes, whereas with 16-bit software, the connection is by TCP/IP.

[SYBASEDB]
query=NLMSNMP,\\sneakers\pipe\sql10\query
win3_query=WNLWNSCK,sneakers,2025

The following example points to a different installation of Sybase on a different host and a different socket, for both 16-bit and 32-bit software. The socket number shown is the default socket number for Sybase 11.

[SYBASE11]
query=NLWNSCK,mucklucs,5001
win3_query=WNLWNSCK,mucklucs,5001


Some Useful Transact SQL Commands

If a graphical DBMS access tool is not available, you can use Transact SQL commands via ISQL. Use the following examples to help you create a device, create a database, and add logins.

Related Topics

  To create a device using Transact SQL

  To create a database using Transact SQL

  To create logins using Transact SQL


To create a device using Transact SQL

To create a device, use the Transact SQL DISK INIT command via ISQL:

DISK INIT NAME = 'mmdata',	/* The logical name. */
PHYSNAME = 'C:\SQL\DATA\mmdata.dat',	/* The physical name. */
VDEVNO = 1<= virtual_device_number => 255
/* System dependent. */
 SIZE = number_of_2K_blocks	/* 1024 here is 2MB!!! */
[, VSTART = virtual_address,	/* Optional */
CNTRLTYPE = controller_number]	/* Optional */


To create a database using Transact SQL

To create a database, use the Transact SQL CREATE DATABASE command via ISQL:

CREATE DATABASE mmmaster
[ON {DEFAULT | database_device} [= size_in_megabytes]	/* The device(s) created in #1. */
[, database_device [= size_in_megabytes]]...]	/* A database can span devices. */
[LOG ON database device [= size_in_megabytes>]	/* Separate log device. */
[, database device [= size_in_megabytes]]...]	/* A transaction log can span devices. */


To create logins using Transact SQL

To add logins to the database, you can refer to the following example of the sp_addlogin and sp_adduser commands using Transact SQL via ISQL:

sp_addlogin login_id [, passwd [, defdb [, deflanguage]]]

and

sp_adduser login_id [, username [, grpname]]

Once you have executed these commands, the DBA can alias an existing login as the ‘Database Owner’ (DBO) or change the DBO to an existing login using sp_changedbowner. Use ISQL to execute:

sp_changedbowner login_id [,true]

where the login_id is the login id of the new database owner.


Troubleshooting Installation Problems

The following chart provides help for solving minor problems that may occur during installation.

Problem	Recommended Solution
You are unable to create the ModelMart during an initial install.	Rerun the ERwin installation program, but clear all of the ERwin Installation Options in the ERwin Installation dialog.
You receive a message that the system logs are full.	Use a DBMS utility (for example, SQL Object Manager) and type the appropriate command (for example, dump tran <erwinmm> with no_log) to purge the transaction log before you install a new version of ERwin.
You need to upgrade your ModelMart software to a newer version.	If you are upgrading to a new ModelMart version, (to open the ModelMart Manager, double-click on the ModelMart Manager Icon in Windows Program Manager) and click the Update button in the ModelMart Manager dialog to update the ModelMart tables and stored procedures without overwriting your existing data.


	Object Names
			erw_Action_Grouping
			erw_Attribute_Group
			erw_Class_Merge_Option
			erw_Column
			erw_DataType
			erw_Dependency_Relationship
			erw_Editor
			erw_Entity
			erw_Foreign_Key
			erw_Index_Type
			erw_Local_Attribute
			erw_Macro_Relationship
			erw_Merge_Option
			erw_Object_Physical_Property
			erw_Permission_Profile
			erw_Physical_Object
			erw_Profile_Assignment
			erw_Relationship
			erw_Session
			erw_Subject_Area_Member
			erw_System
			erw_Trace_Event
			erw_Work2
			idw_Valid_Values


		erw_phys_obj_cascade_delete	erw_phys_prop_table_update
		erw_physical_obj_delete	erw_physical_obj_dependencies
		erw_query_delete	erw_relationship_create
		erw_report_create	erw_report_delete
		erw_repository_close	erw_repository_create
		erw_repository_map_for_odsub	erw_repository_map_for_sae
		erw_repository_map_to_diagrams	erw_repository_map_to_real_sa
		erw_repository_open	erw_repository_status
		erw_rollback_script	erw_session_cleanup
		erw_session_status	erw_start_script
		erw_stored_display_create	erw_stored_display_delete
		erw_subject_area_delete	erw_subject_area_enroll
		erw_subject_area_remove	erw_sync_users
		erw_synonym_delete	erw_sys_info
		erw_table_delete	erw_text_block_create
		erw_trace_purge	erw_udp_def_create
		erw_udpdef_setname	erw_udp_indp_atts
		erw_user_delete	erw_verify_arto_archive
		erwi_access_validate	erwi_archive_att_group


		erwi_archive_column	erwi_archive_diagram
		erwi_archive_entity	erwi_archive_index
		erwi_archive_library	erwi_archive_object
		erwi_archive_persistence_unit	erwi_archive_phys_obj
		erwi_archive_report	erwi_archive_stored_display
		erwi_archive_synonym	erwi_archive_table
		erwi_att_group_create	erwi_att_group_delete
		erwi_attribute_create	erwi_attribute_delete
		erwi_bitmap_dependencies	erwi_check_edit_lock
		erwi_class_validate	erwi_column_create
		erwi_delete_attribute_groups	erwi_delete_attributes
		erwi_delete_columns	erwi_delete_domains
		erwi_delete_entities	erwi_delete_indices
		erwi_delete_prof_assignments	erwi_delete_props
		erwi_delete_stored_displays	erwi_delete_subject_areas
		erwi_delete_tables	erwi_delete_text_blocks
		erwi_diagram_delete	erwi_domain_create
		erwi_domain_dependencies	erwi_dwx_dependencies
		erwi_entity_create	erwi_entity_delete
		erwi_fk_create	erwi_force_sys_table_reload
		erwi_get_archive_name	erwi_get_design_lock
		erwi_get_system_users	erwi_get_udp_id
		erwi_get_user_name	erwi_increment_object_versions
		erwi_index_delete	erwi_index_member_create
		erwi_is_user_dbo	erwi_library_delete
		erwi_non_object_trace	erwi_non_version_trace
		erwi_object_check_lock	erwi_object_create
		erwi_object_dependencies	erwi_object_fast_lock
		erwi_object_get_id	erwi_object_lock
		erwi_physical_obj_delete	erwi_physical_obj_dependencies
		erwi_relationship_create	erwi_relationship_delete
		erwi_report_delete	erwi_session_get_id
		erwi_stored_display_delete	erwi_subject_area_create
		erwi_subject_area_remove	erwi_synonym_create
		erwi_table_create	erwi_table_delete
		erwi_text_block_delete	erwi_trace
		erwi_trace_seq_get_id	erwi_update_links
		erwi_update_sa_member_vers	erwi_update_sa_rel_vers
		erwi_user_sessions_abort	erwii_object_create
		mmi_get_att_names


ModelMart Maintenance Tasks

After installing and initializing the ModelMart, there are several tasks you need to perform to maintain the ModelMart as follows:

•	Upgrading Your ModelMart License . Your license agreement provides access to ModelMart for a specific number of users. If you need to add more users to support your team modeling efforts, you can upgrade your ModelMart license.

•	Upgrading the ModelMart . You may want to upgrade your ModelMart as new versions of the ModelMart software become available.

•	Manage ModelMart Sessions . You want to monitor or delete one or more ModelMart sessions.

Note:	To create, update, or delete the ModelMart, you must be assigned the Administrator secuirty profile in ModelMart and you must be the dbo (for Microsoft SQL Server or Sybase) or the schema owner (for Oracle) of the ModelMart database, or the INFORMIX DBA. See Using ModelMart Security Profiles  for more information.


Upgrading Your ModelMart License

If you need to add more users to support your team modeling efforts than your current license allows, call Logic Works Customer Support to upgrade your license. Logic Works will provide you with a new ModelMart license key which you can use to upgrade your license.

After you receive the new ModelMart license key, simply reinstall Logic Works ModelMart and type your key number in the Serial and License Number dialog.

When you click Next, the Select Components dialog opens so you can choose the components you want to install. To successfully perform the upgrade, you must clear all install option check boxes in the Install Options dialog before you click the Install button. When you click the Install button, your license key is automatically updated.

Related Topics

  To upgrade your ModelMart license


To upgrade your ModelMart license

1.	Insert the Logic Works ModelMart CD-ROM in your CD-ROM drive.

2.	Choose one of the following to open the Run dialog:

•	In Windows 95 or Windows NT version 4.0, click Start, then click Run.

•	In Windows NT version 3.51, from the Windows Program Manager, choose Run from the File menu.

3.	Type d:setup in the Run dialog box, where d, is your CD-ROM drive. A Welcome screen is displayed. Click Next to continue.

4.	Type your name and your company name in the User Information dialog. Click Next to continue.

5.	Type your Logic Works ModelMart serial number and your new ModelMart license key in the Serial and License Number dialog. Click Next to continue.

6.	Clear all of the installation options in the Select Components dialog, then click Next. The Setup Complete dialog is displayed.

7.	Select the Initialize ModelMart check box in the Setup Complete dialog and click the Finish button. You will not actually complete this step, but you must begin this step to update the ModelMart License table. The ModelMart Connection Manager dialog is displayed.

8.	Select an entry in the History box or type the appropriate information to log on to the DBMS that contains the ModelMart. A message prompts you to update your license agreement.

9.	Choose one of the following:

•	Click No to return to Windows.

•	Click Yes to update the license key on the server.

10.	A messages prompts you to update the ModelMart. Choose one of the following:

•	Click Yes to update the ModelMart. More>>

•	Click No to return to Windows. The Logic Works ModelMart program files are not reinstalled and the ModelMart is not updated.


Upgrading the ModelMart

You can use the Logic Works ModelMart CD to upgrade your Logic Works ModelMart from a previous installation. The procedure is the same as installing ModelMart for the first time up to the point where you choose to initialize the ModelMart.

When you choose to initialize the ModelMart, the ModelMart Connection Manager dialog is displayed so that you can log on to your DBMS as the dbo (Microsoft SQL Server or Sybase) or schema owner (Oracle) of the database that contains the ModelMart, or as the DBA of an INFORMIX Server.

If you are upgrading the ModelMart using a different license key, that is during the installation of the ModelMart files you entered a license key that is different than the license key currently stored on the server, a message is displayed informing you that the ModelMart was initialized under a different license key and prompts you to upgrade the license information on the server.

•	If you click No, a message informs you that the administrative setup is complete. Click OK to return to Windows.

•	If you click Yes, the license information on your server is updated and the upgrade continues.

Then, a message informs you that a ModelMart already exists and prompts you to update it.

•	If you click No, the existing ModelMart is left intact and the ModelMart Security Manager opens so that you can add and remove ModelMart users and assign ModelMart security profiles.

•	If you click Yes, the ModelMart Manager opens so that you can update the ModelMart tables and stored procedures in the ModelMart database.

You use the Update button to start the upgrade process which updates ModelMart tables and stored procedures as necessary. The upgrade process is different depending on your DBMS. See one of the following topics for more information.

•	To upgrade the ModelMart on a Microsoft SQL Server or Sybase DBMS

•	To upgrade the ModelMart on an Oracle DBMS

•	To upgrade the ModelMart on an INFORMIX Server

When the upgrade process is complete, the ModelMart Security Manager is displayed so that you can add and remove ModelMart users and assign ModelMart security profiles. See Creating ModelMart Users  for more information.


To upgrade the ModelMart on a Microsoft SQL Server or Sybase DBMS

1.	Insert the Logic Works ModelMart CD in your CD-ROM drive.

2.	Open the Run dialog,

•	In Windows 95 or Windows NT version 4.0, click Start, then click Run.

•	In Windows version 3.1x or Windows NT version 3.51, choose Run on the File menu in the Windows Program Manager.

3.	Type d:setup in the Run dialog, where d, is your CD-ROM drive and follow the instructions on your screen until the Setup Complete dialog is displayed.

4.	Select the Initialize ModelMart check box in the Setup Complete dialog, then click Finish to open the ModelMart Connection Manager.

5.	Type the login name and password for the dbo of the database that contains the ModelMart, then click Advanced.

6.	Choose one of the following:

•	Select your DBMS and connection information from the History box if you previously typed the information.

•	Select your DBMS version and connection library (for example, SQL Server Vers.6 - using db-lib) in the Host DBMS box, type the server name (for example, sql6) in the DBMS Connection box, and type the name of your ModelMart in the ModelMart Master Database box.

7.	Click OK. The Setup program displays a message if the ModelMart was initialized under a previous license and prompts you to upgrade the license information on the server. Choose one of the following:

•	Click No to return to Windows.

•	Click Yes to update the license information and continue with the upgrade.

8.	The program then detects an existing ModelMart and prompts you to update it. Choose one of the following:

•	Click No. The existing ModelMart left intact and the ModelMart Security Manager dialog is displayed so that you can add and remove ModelMart users and assign ModelMart security profiles.

•	Click Yes. The ModelMart Manager dialog is displayed so that you can update the existing ModelMart.

9.	Select the database in which the ModelMart is stored in the Database box, then click the Update button to update the ModelMart tables, or click the Delete button to delete the ModelMart tables. The ModelMart Security Manager dialog is displayed.

10.	Optionally, you can add and remove ModelMart users and assign security profiles or click the Cancel button to postpone the security management tasks until a later time. More>>

11.	A message indicates that the setup is complete. Click OK.

Note:	If you are upgrading from a previous ModelMart release and the system logs are full, you may not be able to overwrite your previous ModelMart installation with the current release. Before you install the new version or ModelMart, use a DBMS utility (such as, SQL Object Manager) and type the appropriate command to purge the transaction log. See the Logic Works ModelMart RDBMS Tuning Guide for more information about Database and Log Sizing.


To upgrade the ModelMart on an Oracle DBMS

1.	Insert the Logic Works ModelMart CD in your CD-ROM drive.

2.	Choose one of the following to open the Run dialog:

•	In Windows 95 or Windows NT version 4.0, click Start, then click Run.

•	In Windows version 3.1x or Windows NT version 3.51, choose Run on the File menu in the Windows Program Manager.

3.	Type d:setup in the Run dialog, where d, is your CD-ROM drive and follow the instructions on your screen until the Setup Complete dialog is displayed.

4.	Select the Initialize ModelMart check box in the Setup Complete dialog, then click the Finish button to open the ModelMart Connection Manager. You can use the ModelMart Connection Manager to log on to the DBMS that contains the ModelMart.

5.	Type the login name and password for the schema owner of the database that contains the ModelMart, then click the Advanced button.

6.	Choose one of the following:

•	Select your DBMS and connection information from the History box if you previously typed the information.

•	Select your DBMS version (for example, Oracle Vers. 7.x) in the Host DBMS box and type the connection string (for example, mm.world) in the DBMS Connection box.

7.	Click OK. A message indicating that the ModelMart was initialized under a previous license is displayed which prompts you to upgrade the license information on the server. Choose one of the following:

•	Click No to return to Windows.

•	Click Yes to update the license information and continue with the upgrade.

8.	A message indicates that a ModelMart exists and prompts you to update it. Choose one of the following:

•	Click No. The existing ModelMart is left intact and the ModelMart Security Manager dialog is displayed so that you can add and remove ModelMart users and assign ModelMart security profiles.

•	Click Yes. The ModelMart Manager dialog is displayed so that you can update or delete the existing ModelMart tables and index tables in the respective tablespaces.

9.	In the ModelMart Manager dialog:

•	Select an Oracle security role that you want to assign to all ModelMart users in the ModelMart Role box.

•	Select the tablespace that contains the ModelMart tables in the Table Tablespace box.

•	Select the tablespace that contains the ModelMart table indexes in the Index Tablespace box.

•	Click the Update button to update the ModelMart tables and index tables for the new installation.

•	Click the Delete button to delete the existing ModelMart tables and index tables.

The ModelMart is automatically updated and the ModelMart Security Manager dialog is displayed.

10.	Optionally, you can add and remove ModelMart users and assign security profiles or click the Cancel button to postpone the security management tasks until a later time. More>>

11.	A message informs you that the update process is complete. Click OK.


To upgrade the ModelMart on an INFORMIX Server

1.	Insert the Logic Works ModelMart CD in your CD-ROM drive.

2.	Choose one of the following to open the Run dialog:

•	In Windows 95 or Windows NT version 4.0, click Start, then click Run.

•	In Windows version 3.1x or Windows NT version 3.51, choose Run on the File menu in the Windows Program Manager.

3.	Type d:setup in the Run dialog box, where d, is your CD-ROM drive and follow the instructions on your screen until the Setup Complete dialog is displayed.

4.	Select the Initialize ModelMart check box in the Setup Complete dialog, then click the Finish button to open the ModelMart Connection Manager. You can use the ModelMart Connection Manager to log on to the DBMS that contains the ModelMart.

5.	Type the INFORMIX DBA login name and password, then click the Advanced button.

6.	Choose one of the following:

•	Select your DBMS and connection information from the History box if you previously typed the information.

•	Select your DBMS version (such as, Informix Vers. 7/9.xx) in the Host DBMS box and type the name of the ODBC data source (for example, informix911) that you are using to access the INFORMIX database in which the ModelMart is installed in the DBMS Connection box.

7.	Click OK. A message indicating that the ModelMart was initialized under a previous license is displayed which prompts you to upgrade the license information on the server. Choose one of the following:

•	Click No to return to Windows.

•	Click Yes to update the license information and continue with the upgrade.

8.	A message indicates that a ModelMart exists and prompts you to update it. Choose one of the following:

•	Click No. The existing ModelMart is left intact and the ModelMart Security Manager dialog is displayed so that you can add and remove ModelMart users and assign ModelMart security profiles.

•	Click Yes. The ModelMart Manager dialog is displayed so that you can update or delete the existing ModelMart tables and stored procedures in the selected database, that is, the database referenced by the ODBC data source you use to connect to the server in Step 6.

9.	In the ModelMart Manager dialog:

•	Click the Update button to update the ModelMart tables and stored procedures for the new installation.

•	Click the Delete button to delete the existing ModelMart tables and stored procedures.

The ModelMart is automatically updated and the ModelMart Security Manager dialog is displayed.

10.	Optionally, you can add and remove ModelMart users and assign security profiles or click the Cancel button to postpone the security management tasks until a later time. More>>

11.	A message informs you that the update process is complete. Click OK.


Managing ModelMart Sessions

When a user logs on to the ModelMart, this event is recorded as the start of a ModelMart session. During a session, ModelMart tracks the diagrams or models that a user opens and the current lock mode of each diagram or model. As the ModelMart Administrator, you may need to terminate a user’s session so that others can access any diagrams or models locked by that user. For example, if a user is working offsite on a model and has locked the corresponding model in ModelMart, you can terminate the user’s session to unlock the model in ModelMart so that others can access it.

When you choose ModelMart Session Manager on the ModelMart menu, the ModelMart Session Manager dialog opens and you can see which models are locked and terminate the session if necessary.

The Users list displays all ModelMart users, regardless of whether or not they are currently logged on to ModelMart. When you select a ModelMart user in the Users list, the Open Diagrams or Open Models list displays all the open diagrams or models for the selected user. The lock status of the diagram or model is indicated by the locked ( [image]) or unlocked ( [image]) symbol that appears before the diagram or model name.

To terminate a session, click on a user name in the Users list then click the Terminate button. If you are terminating your own session, you are prompted to save any unsaved work, any diagrams or models that you have locked are automatically unlocked, and your session is terminated. If you are terminating another user’s session, any locks placed on the diagrams or models opened by that user are removed and the session is terminated, which prevents the user from saving current changes back to the ModelMart.

Note:	If a ModelMart client (such as ERwin or BPwin) is interrupted by a system failure, all diagram and model locks are removed, and the appropriate sesssion(s) are terminated. When a user who previously locked a diagram or model logs on after a system failure, a new session starts and informs you that the locked diagram or model has been automatically unlocked.

Related Topics

  To terminate a ModelMart session


To terminate a ModelMart session

1.	Choose ModelMart Session Manager on the ModelMart menu.

2.	Select the user whose session you want to terminate in the Users list.

3.	Click the Terminate button. Any locks the user placed on diagrams or models are removed, and the selected session is terminated.

Note:	You must be assigned the ModelMart Administrator security profile to terminate a ModelMart session.


Using the ModelMart Manager

When installing or upgrading the ModelMart administrative files, you can choose not to initialize or upgrade the ModelMart database on your DBMS. After you install the administrative files, you can use the ModelMart Manager to initialize or upgrade the ModelMart database at any time.

You can start the ModelMart Manager using the Logic Works ModelMart Manager icon in the Logic Works ModelMart Manager program group. The ModelMart Connection Manager dialog is the first dialog that is displayed. You must log on to the DBMS as the dbo (Microsoft SQL Server or Sybase) or the schema owner (Oracle) of the database that contains the ModelMart, or the DBA of an INFORMIX server before you can access the ModelMart Manager.

After you log on to the DBMS, a ModelMart Manager dialog appropriate to your DBMS is then displayed so that you can create, update, or delete the ModelMart.

To initialize the ModelMart, see one for the following topics:

•	To initialize the ModelMart on a Microsoft SQL Server or Sybase DBMS

•	To initialize the ModelMart on an Oracle DBMS

•	To initialize the ModelMart on an INFORMIX Server

To upgade the ModelMart, see one for the following topics:

•	To upgrade the ModelMart on a Microsoft SQL Server or Sybase DBMS

•	To upgrade the ModelMart on an Oracle DBMS

•	To upgrade the ModelMart on an INFORMIX Server

Note:	In ERwin, if you log on to the DBMS as the appropriate user as described above, and if you are assigned the Administrator security profile, you can choose ModelMart Manager from the ModelMart menu to start the ModelMart Manager.

Related Topics

  To start the Logic Works ModelMart Manager


To start the Logic Works ModelMart Manager

1.	Choose one of the following to open the ModelMart Connection Manager dialog:

•	In Windows 95 or Windows NT version 4.0, click Start, point to the Programs icon, point to the Logic Works ModelMart Manager folder, then click the Logic Works ModelMart Manager program icon.

•	In Windows version 3.1x or Windows NT version 3.51, open the Windows Program Manager, open the Logic Works ModelMart Manager program group and double-click the Logic Works ModelMart Manager program icon.

The ModelMart Connection Manager dialog is displayed.

2.	Choose one of the following:

•	If you DBMS is Microsoft SQL Server or Sybase, type the name and password for the dbo of the database that contains the ModelMart.

•	If you DBMS is Oracle, type the name and password for the schema owner of the database that contains the ModelMart.

•	If you DBMS is an INFORMIX server, type the name and password for the INFORMIX DBA.

3.	Choose one of the following:

•	Select your ModelMart connection settings from the History list, if you typed the ModelMart connection information previously.

•	Click the Advanced button, and specify the ModelMart connection information as follows:

•	If your DBMS is Microsoft SQL Server or Sybase:

Select the appropriate DBMS version and connection library (for example, SQL Server Vers. 6 - using db-lib) in the Host DBMS box.

Type the server name (for example, sql6) in the DBMS Connection box.

Type the name of the database that contains the ModelMart Control Tables (for example, erwinmm) in the ModelMart Master Database box.

•	If your DBMS is Oracle:

Select the appropriate DBMS version (for example, Oracle Vers. 7.x) in the Host DBMS box.

Type the server name (for example, mm.world) in the DBMS Connection box.

•	If your DBMS is an INFORMIX server:

Select the appropriate DBMS version (for example, INFORMIX version 7/9.xx) in the Host DBMS box.

Type the name of the ODBC data source you are using to access the INFORMIX database that contains the ModelMart in the DBMS Connection box.

4.	Click OK. A connection with the selected server is established and the ModelMart Manager dialog is displayed.

Note:	When you open the ModelMart Manager, then click Close, the ModelMart Security Manager is displayed. You can use the ModelMart Security Manager to manage the ModelMart users and security profiles. See Using ModelMart Security Features  for more information.


Browsing and Reporting on ModelMart Information

ModelMart users typically work from a common set of libraries, models, diagrams, and submodels, and must be able to share information about these objects with other users. One way to share information is in the form of reports, which detail the information and definitions of a model in a tabular format.

Users can run a number of ModelMart reports in the Report Browser to view the contents of specific libraries and diagrams, and can also use standard and customized ERwin reports to see the diagram information in more detail. If your company has standardized on a specific set of ERwin reports, you can also save these reports in the ModelMart so that they are available to all ModelMart users.

The Report Browser stores the definitions of standard and customized reports. These definitions appear in the report tree on the left side of the Browser. Reports are classed into four main categories:

•	ERwin Reports - [ERP file name]. This folder contains all standard and customized ERwin reports in the active .erp file. Each ERwin report lists a selected set of diagram objects, such as entity and table names and definitions, for a single diagram.

•	Shared ERwin Reports. This folder contains ERwin reports saved to the ModelMart by the ModelMart Administrator. This folder appears in the tree control if one or more ERwin reports are shared, and the user is connected to the ModelMart.

•	ModelMart <Name>. This folder contains ModelMart reports organized by library name and diagram or model name. The ModelMart <Name> folder is only displayed if you have a connection to ModelMart.

•	General. This folder contains ModelMart reports organized by object class (for example, Global, Library, Diagram, and so on). The reports in each class run across the entire contents of that class. For example, global reports run across the ModelMart, and library reports run across all diagrams in the library. The General folder is only displayed if you have a connection to ModelMart.

In addition, a ModelMart user can generate reports directly from several ModelMart manager dialogs as follows:

•	Script Reports. This folder is displayed when you click the Report Browser button in the ModelMart Change Control Manager toolbar. The reports in this folder generate result sets that contain information about model changes and conflicts.

•	Library Reports. This folder is displayed when you click the Report button in the ModelMart Library Manager dialog. The report in this folder generates a result set that contains details about the objects in each ModelMart library.

•	Security Reports. This folder is displayed when you click the Report button in the ModelMart Security Manager dialog. The report in this folder generates a result set that contains details about the security profile assigned to each ModelMart user and the permissions granted in each security profile.

Related Topics

  ModelMart Administrative Reports

  Using the Report Browser with ModelMart


ModelMart Administrative Reports

The General folder contains ModelMart reports organized by object class such as, Global, Library, Diagram, and so on. The reports in each class run across the entire contents of that class. For example, global reports run across the ModelMart, and library reports run across all diagrams in the library. This folder appears in the tree control when you are connected to the ModelMart.

Many of the reports in the General folder can be used to support ModelMart administration. For example, Global reports let you view information about existing diagram locks, open objects, and ModelMart users.

To run a report, double-click on any report name associated with the report icon ( [image]). ERwin generates the report and displays the result set in the Result Set Area.

After you run a report and generate a result set, you can customize the content and appearance of the result set and create and save your own custom report views. You can use the Report Browser search features to find information in the result set. You can also specify a search expression (which can include strings, numbers, or dates) for one or more columns so that the Report Browser finds only the result set rows that satisfy all the search expressions. You can also find a change of value in a column, and hide result set rows that do not match the search.

There are two specific reporting tasks that the ModelMart Administrator performs:

•	Create a ModelMart Secuirty Manager Report

•	Create Shared ERwin Reports


Creating a ModelMart Security Manager Report

When you click the Report button in the ModelMart Security Manager dialog, the Report Browser opens. The tree control in the Report Browser displays a Security Reports folder that contains one predefined Security Report. When you double-click on the Security Report icon in the tree control, the Report Browser generates the result set that provides information about the security profiles assigned to each ModelMart user and the permissions associated with those profiles.

After you generate the report, you can use the Report Browser features to customize the appearance of a result set, find one or more specific items in the result set, print the result set, or export the result set. See Customizing a Result Set View  for more information.

Note:	You can also generate a report on changes you have made using the ModelMart Security Manager. See Creating a ModelMart Change Control Manager Report for more information.

Related Topics

  ModelMart Security Manager Report Information

  To create a ModelMart Security Manager Report

  Sample ModelMart Security Manager Report


To create a ModelMart Security Manager Report

1.	In the ModelMart Security Manager dialog, click the Report button. The Report Browser opens.

2.	In the Report Browser tree control, open the Security Reports folder.

3.	Double-click on the Security Report icon. The Report Browser generates a result set that contains information about the security profile assigned to each ModelMart user and the permissions granted by each secuirty profile.

Related Topics

  Sample ModelMart Security Manager Report


ModelMart Security Manager Report Information

The standard Security Report generates a result set with the following information:

•	User Name. The name of the ModelMart user. For example, JSMITH.

•	Object Class Name. The class of the object. For a ModelMart Security Manager Report, this is always ModelMart.

•	Object Name. The name of the object. For example, Current ModelMart.

•	Profile Name. The security profile name. For example, Architect.

•	Profile Description. A description of the security profile. For example, A profile assigned to a lead modeler.

•	Permission Type Name. The name of the permission in a security profile. For example, Create Diagram.

•	Granted. The permission status; 1 indicates the permission is granted, blank indicates the permission is not granted.

Related Topics

  Sample ModelMart Secuirty Manager Report


Sample ModelMart Security Manager Report

The report shown below is an example of a ModelMart Security Manager report.

Related Topics

  ModelMart Security Manager Report Information


Creating Shared ERwin Reports

Using the Report Browser, you can select individual ERwin reports and promote them to the ModelMart, for company-wide use.

When you click [image] on the ERwin toolbar, ERwin displays the Report Browser. If the reports you want to save in ModelMart appear in the active ERwin Reports (.ERP) file, you can copy them to ModelMart simply by selecting the report in the tree control and then choosing the Copy Report to ModelMart option on the ERwin Reports menu.

The first time an administrator saves an ERwin report in the ModelMart, the Report Browser creates a new top-level folder called Shared ERwin Reports. When a report is copied, the Report Browser keeps the folder structure associated with a report, and lists it under the Shared ERwin Reports folder. For example, when the ERwin Reports/Entity Reports/Attributes report, shown in the tree control above, is saved to the ModelMart, it becomes the Shared ERwin Reports/Entity Reports/Attributes report.

Only a ModelMart user with an Administrator security profile can:

•	Create a shared ERwin report.

•	Edit a shared ERwin report.

•	Create a new report folder to store result sets.

•	Delete a shared ERwin report.

Note:	ModelMart does not currently provide versioning and merging features for reports. If multiple administrators are editing and saving shared ERwin reports to the ModelMart, changes may be overwritten.

ModelMart users who have the Report Browser open when a change is applied do not see the change immediately. The change appears when they reopen the Report Browser.

Related Topics

  To copy an ERwin report to ModelMart

  To modify or delete a report in the Shared ERwin Reports folder


To copy an ERwin report to ModelMart

1.	Log on to the ModelMart in which you want to store the ERwin report. More>

2.	Click [image].

3.	Click [image] on the ERwin Reports folder and locate the report you want to save in the report tree.

•	If you cannot locate the report, you may need to open a different ERwin Reports file.

4.	Select the report name that you want to copy to ModelMart.

5.	Choose Copy Report to ModelMart on the ERwin Reports menu. ERwin copies the selected report to the Shared ERwin Reports folder.

Note:	The Copy Report to ModelMart option is available if you are assigned the Administrator profile, and is unavailable (dimmed) for all other users.


To modify a report in the Shared ERwin Reports folder
To modify or delete a report in the Shared ERwin Reports folder

1.	Log on to the ModelMart that contains the shared ERwin report. More>

2.	Click [image].

3.	Click [image] on the Shared ERwin Reports folder and locate the report you want to modify.

4.	Choose one of the following options:

•	To modify the report contents, sort order, or format, right-click on the report name, then choose Edit ERwin Report <report name> on the shortcut menu. When you have finished editing the report, click OK.

•	To delete the report, select the report, then press the DELETE key.

Note:	The Edit ERwin Report <report name> option is available if you are assigned the Administrator profile, and is unavailable (dimmed) for all other users.


1.

2.

3.

4.


1.

2.

3.


Using ModelMart Security Features

ModelMart provides a comprehensive security system that prevents unauthorized users from modifying or deleting objects in the ModelMart. To ensure security, all ModelMart objects are divided into hierarchical security classes. Similarly, all ModelMart users are assigned to a ModelMart security profile, which controls what actions they can perform on a particular class of object.

During installation, five hierarchical security profiles including Administrator (highest security profile), Architect, Modeler, Viewer, and Guest are automatically created. By default, the person who creates the ModelMart is automatically assigned an Administrator security profile, with unlimited access to all ModelMart objects and the ability to create additional users and assign their security privileges. By assigning a user to a particular security profile, the ModelMart Administrator can easily control the actions that a user can perform on a given type of object. By assigning a user to more than one security profile, the administrator can customize each user’s rights to manipulate objects in the ModelMart.

In addition to the default security profiles shown above, the ModelMart administrator can define any number of new security profiles and customize the permissions in each profile by simply selecting the available permissions.

For convenience, a user inherits ModelMart security privileges. When you assign a user to a security profile, he or she is automatically granted equivalent permissions on all lower level ModelMart objects unless you specifically assign that user to a different profile for a specific object class. By assigning users to a higher security profile and then overriding each user’s default permissions when necessary, the ModelMart Administrator can reduce the amount of effort required to manage access to the ModelMart.

ModelMart automatically manages your license agreement by counting every user you add as a licensed user. If the number of users exceeds the limit of your license agreement, a warning message prompts you to remove the unauthorized users. If your team includes members who use the Navigator edition of a ModelMart client (such as ERwin/Navigator or BPwin/Navigator), you can assign them to the Guest security profile, a special security profile that is not counted toward your license limit.

Using the ModelMart security features, you can:

•	Add or remove a new ModelMart user.

•	Assigning a ModelMart Security Profile to a User.

•	Override a user’s ModelMart security profile.

•	Create, modify, or delete a ModelMart security profile.

•	Use security to manage your license agreement.


Creating ModelMart Users

When you choose the ModelMart Security Manager on the ModelMart menu, the ModelMart Security Manager dialog opens and displays the existing ModelMart users in the User list.

Click the User button on the ModelMart Security Manager dialog to open the ModelMart Users in ModelMart dialog. In the ModelMart dialog, you can create and remove ModelMart users and modify ModelMart user names.

The DBMS Login Name list in the left pane displays the name of each user that has permission to access the database that contains the ModelMart. The ModelMart User Name list in the right pane displays the corresponding ModelMart user name for each user that has permission to access the ModelMart. If the ModelMart User Name opposite a particular DBMS Login Name is blank, the user cannot access the ModelMart.

A green login symbol ( [image]) is displayed next to your user name and a red login symbol is displayed next to all other users that are currently logged on to ModelMart. You cannot delete or modify a ModelMart user name (including your own) while the user is logged on to ModelMart.

Your ModelMart multiuser license code determines the maximum number of users that can access the ModelMart. See the Logic Works ModelMart Administrator’s Guide for more information about your ModelMart License Agreement.

Note:	A user must have permission to access the database that contains the ModelMart before you can grant the user permission to access ModelMart. See your DBMS administrator’s documentation for more information.

The login symbol in the ModelMart Users in ModelMart dialog indicates that a user is currently logged on to ModelMart.

Related Topics

  To add a ModelMart user

  To change a ModelMart user name

  To remove a ModelMart user


To add a ModelMart user

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Click the User button to open the Users in ModelMart dialog.

3.	Click on the name of the user you want to add to the ModelMart in the DBMS Login Name list.

4.	Type the user name that you want to assign to the user in the ModelMart User Name box, then click the Add button. The user appears in the ModelMart User Name list.

5.	Click OK to open the ModelMart Security Manager dialog.

Note:	ModelMart automatically assigns the default security profile (marked with an asterisk symbol [*] in the Security Profile box in the ModelMart Security Manager dialog) to each new ModelMart user. See Creating and Modifying ModelMart Security Profiles  for more information. for more information on changing the default security profile.


To change a ModelMart user name

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Click the User button to open the Users in ModelMart dialog.

3.	Click the name you want to change in the ModelMart User Name list. The selected name appears in the User Name box and the Remove button is displayed.

4.	Click the Remove button. The user name is removed from the ModelMart User Name list (but not from the User Name box) and the Add button is displayed.

5.	Use the appropriate edit keys to edit the name or type a new user name in the ModelMart User Name box, then click the Add button. The ModelMart User Name list is updated.

6.	Click OK to open the ModelMart Security Manager dialog.


To remove a ModelMart user

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu to open the ModelMart Security Manager dialog.

2.	Click the User button to open the ModelMart Users in ModelMart dialog.

3.	Click the name of the user you want to remove in the ModelMart User Name list. The Remove button is displayed in the top-right corner of the dialog.

4.	Click the Remove button. The selected user name is removed from the ModelMart User Name list. The DBMS Login Name is unaffected.

5.	Click OK to open the ModelMart Security Manager dialog.


Using ModelMart Security Profiles

A ModelMart security profile is a set of permissions that control what actions a user can perform on a specific group of objects, called a permission object class, in the ModelMart. During installation, five default security profiles are created including Administrator (highest security profile), Architect, Modeler, Viewer, and Guest. Each security profile grants a set of permissions on a set of ModelMart permission object classes.

A security profile associates an object class and a set of permissions with a user name to prevent the user from making unauthorized changes to the ModelMart. Whenever a user attempts to create, modify, or delete an object, the user’s security profile is checked to determine if the operation is permitted for that user.

To support custom security requirements, you can assign users to the default security profiles, create new security profiles, or assign a user to a different security profile for different objects.

Related Topics

  Assigning a ModelMart Security Profile to a User

  Inheriting and Overriding Security Permissions

  Creating and Modifying ModelMart Security Profiles

  Summary of ModelMart Default Security Profiles for ERwin

  Summary of ModelMart Default Security Profiles for BPwin


Assigning a ModelMart Security Profile to a User

When you add a new ModelMart user, you must assign at least one security profile to that user, which thereafter controls what types of actions (view, create, modify, delete) the user can perform. By default, the Guest profile is assigned automatically to all new ModelMart users. See Creating and Modifying ModelMart Security Profiles  for more information on changing the default security profile.

When you choose ModelMart Security Manager on the ModelMart menu, the ModelMart Security Manager dialog is displayed. To assign a security profile to a user, first select the permission object class (for example, ModelMart) in the list box, then click and drag the person’s user name in the User list to the appropriate security profile icon in the Security Profile list. For example, if you first select ModelMart and then drag Lisa to the Administrator profile and Mark to the Architect profile, then Lisa is granted Administrator-level permissions on the ModelMart and Mark is granted Architect-level permissions.

By assigning a user to a particular security profile, you can control the actions that the user can perform on a given type of object. By assigning a user to more than one security profile, you can customize each user’s rights to manipulate objects in the ModelMart. For example, you can assign a user to the default Architect profile, which grants extensive read or write privileges, in one ModelMart library and assign the same user to the Viewer profile, which grants no permissions, in a second library.

When you assign security profiles to ModelMart users, use the following guidelines:

•	Assign the Administrator profile to the ModelMart user responsible for creating and deleting the ModelMart, adding and removing ModelMart users, and assigning ModelMart users to security profiles.

•	Assign the Architect profile to experienced modelers who will be responsible for managing one or more ModelMart libraries, including the objects in those libraries.

•	Assign the Modeler profile to other ModelMart users that need to work on ERwin diagrams or BPwin models stored in the ModelMart.

•	Assign the Viewer profile to users who should be able to view, but not alter, ERwin diagrams or BPwin models stored in ModelMart. The default Viewer profile has no create, update, or delete permissions.

•	Assign the default Guest profile to users that are using the Navigator edition of a ModelMart client (such as ERwin/Navigator or BPwin/Navigator) to access ModelMart. The default Guest profile has no create, update, or delete permissions and is assigned at the ModelMart level. ModelMart does not count users assigned to the Guest profile as licensed users. See Using Security to Manage Your License Agreement  for more information.

Related Topics

  To assign a user to a ModelMart security profile

  To reassign a user to a different ModelMart security profile

  To remove a user from a ModelMart security profile


To assign a user to a ModelMart security profile

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Select the ModelMart permission object class for which you want to assign security in the list box at the top of the dialog.

3.	Choose one of the following to assign a user to a security profile:

•	Drag the icon for the user from the User list onto the desired security profile icon in the Security Profile list.

•	Click on the icon for a user, click on the desired security profile icon in the Security Profile list, then click the >> button.

4.	Click OK to open the Change Control Manager dialog and review the changes you have made. Click OK to save your changes to ModelMart.

Note:	When you add a user to the ModelMart in the ModelMart Security Manager, ModelMart checks your license agreement to determine how many users are permitted to save information to your ModelMart. When you click OK in the ModelMart Security Manager and you have exceeded the number of users permitted by your license, a message informs you that you have violated your license agreement. Be sure to assign the default Guest security profile to all users that are using the Navigator edition of a ModelMart client (such as ERwin/Navigator or BPwin/Navigator) so that they will not be counted as licensed users.


To reassign a user to a different ModelMart security profile

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Select the ModelMart permission object class for which you want to reassign security in the list box at the top of the dialog.

3.	If the user is assigned to a profile for this object already, click the plus sign [image] next to the appropriate profile in the Security Profile list to display the list of user names, and drag the user name back to the User list. The user is removed from the Security Profile list.

4.	To reassign the user to a different security profile, drag the icon for the user from the User list to the desired security profile in the Security Profile list.

5.	Click OK. The Change Control Manager dialog is displayed so that you can review the changes you have made. Click OK to save your changes to ModelMart.


To remove a user from a ModelMart security profile

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Select the ModelMart permission object class from which you want to remove the user in the list at the top of the dialog.

3.	Display the list of user names for the appropriate profile by clicking on the plus sign [image] in the Security Profile list.

4.	Choose one of the following to remove the user from the security profile.

•	Drag the icon for the user to the User list.

•	Click on the icon for a user under the security profile in the Security Profile list, then click the << button.

5.	Click OK. The Change Control Manager dialog is displayed so that you can review the changes you have made. Click OK to save your changes to ModelMart.


Inheriting and Overriding Security Permissions

ModelMart security permissions are automatically inherited by all permission object classes lower in the class hierarchy unless specifically overridden by another security profile.

For example, if you assign a user the Architect profile for the ModelMart level, the user is automatically assigned Architect-level permissions for all object classes below it in the ModelMart object hierarchy. In this arrangement, you can assign a global security profile to a user at the ModelMart level, then grant or deny additional permissions in lower-level object classes by assigning a different security profile.

In addition, you can also assign a security profile to a user for an individual object. A security profile assigned to a specific object overrides any security permissions inherited from a higher-level object class.

To override security permissions inherited by a user, click on a permission object class or an individual object, then drag the user to the desired security profile.

If you assign a user to a new security profile, the user retains all permissions granted by other security profiles, except for the permissions that are overridden by the new security profile.

Note:	By default, both the Viewer and Guest security profiles are read-only security profiles at the ModelMart level. When a user is assigned to a read-only security profile, ModelMart automatically applies the permissions defined in that profile to all lower object classes in the ModelMart, as shown in the illustration above. While you can assign the Viewer profile to limit the permissions of a user in a particular object class, it is better to use the Guest profile exclusively for users that are using the Navigator edition of a ModelMart client (such as ERwin/Navigator or BPwin/Navigator) to access ModelMart. See Using Security to Manage Your License Agreement  for more information.

Related Topics

  To override a user's inherited security permissions

  To assign a security profile for a specific object


To override a user's inherited security permissions

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Select the object class (or individual object) for which you want to override the user’s inherited security permissions.

3.	Drag the icon for the user from the User list to the desired security profile in the Security Profile list. The security profile you assign for a specific object overrides any security permissions inherited from a higher-level permission object class.

4.	Click OK to open the Change Control Manager dialog and review the changes you have made. Click OK to save your changes to ModelMart.


To assign a security profile for a specific object

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Select the individual object (for example, the accounting Library) for which you want to override the user’s inherited security permissions.

3.	Drag the icon for the user from the User list to the desired security profile in the Security Profile list. The security profile you assign for a specific object overrides any security permissions inherited from a higher-level permission object class.

4.	Click OK to open the Change Control Manager dialog and review the changes you have made. Click OK to save your changes to ModelMart.


Creating and Modifying ModelMart Security Profiles

In the ModelMart Security Profile Manager dialog, you can create a new security profile, change the permissions associated with an existing profile, or delete an existing profile. Click the Profile button at the top of the ModelMart Security Manager dialog to open the ModelMart Security Profile Manager dialog.

The Security Profile list at the top of the dialog displays all the existing security profiles. To create a new profile, type the name in the Profile Name box that you want to assign to the profile and click New. The new profile is added to the Security Profile list. By default, new profiles have no permissions granted. To change the name of a profile, click on that profile, edit the name in the Profile Name box, and click Update. To delete an existing profile, select the profile and then click the Delete button.

The Object Class list in the lower-left corner of the dialog shows a hierarchical list of the ModelMart permission object classes. When you click on an object class, the Permission list in the right pane displays all the available permissions for the selected object class. If permission is granted to the current profile, the check box next to the permission is selected. If permission is denied, the check box next to the permission is cleared. See Summary of ModelMart Default Security Profiles for ERwin  or Summary of ModelMart Default Security Profiles for BPwin  for more information.

To change the permissions associated with a security profile, select the profile (for example, Architect), click on the appropriate object class (for example, ModelMart), then select the check box to grant permission to perform an activity (for example, Create Library).

The security profile that is automatically assigned to new ModelMart users is called the Default profile, and is marked in the Profile Name list with an asterisk (*). When a ModelMart client (such as ERwin or BPwin) is installed, the default profile is Guest. To change the default profile, click on the profile that you want to make the default, then click the Make Default button.

Note:	In order to create, update, or delete a security profile, you must be assigned to the Administrator security profile for the ModelMart. By default, the Guest security profile prevents a user from creating, updating, or deleting information in the ModelMart. Do not change the permissions associated with the Guest security profile. Assign the Guest security profile exclusively to users who use a Navigator edition of a ModelMart client (such as ERwin/Navigator or BPwin/Navigator). See Using Security to Manage Your License Agreement for more information.

Related Topics

  To create a new ModelMart security profile

  To delete a ModelMart security profile

  To modify a ModelMart security profile


To create a new ModelMart security profile

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Click the Profile button to open the ModelMart Security Profile Manager dialog.

3.	Type the name of the new profile (for example, Library Leader) in the Profile Name box.

4.	Click the New button to add the profile to the Security Profile list. By default, no permissions are granted to a new profile.

5.	Click on the object class (for example, Library) in the Object Class list for which you want to grant or deny one or more permissions in the new profile.

6.	For each object class, select the appropriate check box to grant a particular permission.

7.	Repeat Steps 5 and 6 for each object class to which you want to assign one or more permissions.

8.	When you finish assigning one or more permissions for each object class, click Update to save the changes.

9.	Click OK to open the ModelMart Security Manager dialog.

Note:	In order to create a new security profile, you must be assigned to the Administrator security profile for the ModelMart.


To delete a ModelMart security profile

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Click the Profile button to open the ModelMart Security Profile Manager dialog.

3.	Click on the profile that you want to delete in the Security Profile list.

4.	Click the Delete button to delete the profile.

Note:	In order to delete a security profile, you must be assigned to the Administrator security profile for the ModelMart.


To modify a ModelMart security profile

1.	Click the ModelMart User Permissions [image] button on the ModelMart toolbar or choose ModelMart Security Manager on the ModelMart menu.

2.	Click the Profile button to open the ModelMart Security Profile Manager dialog.

3.	Click on the profile that you want to change in the Security Profile list (for example, Modeler).

4.	In the Object Class list, click on the object class (for example, Library) on which you want to grant or deny one or more permissions. The Permission list displays the current permissions.

5.	For each permission, accept the default permission status or change the assignment. To grant or deny a particular permission, select or clear the appropriate check box.

6.	Repeat Steps 4 and 5 for each object class on which you want to change one or more permissions.

7.	When you finish assigning one or more permissions to each object class for the selected profile, click Update to save the changes.

8.	Click OK to open the ModelMart Security Manager dialog.

Note:	In order to change permissions for a security profile, you must be assigned to the Administrator security profile for the ModelMart. Whenever you change a value in the ModelMart Security Manager and click OK to close the dialog, the ModelMart Change Control Manager - Review Changes dialog is displayed so that you can confirm your changes. See Using the ModelMart Change Control Manager for more information.


Summary of ModelMart Default Security Profiles for ERwin

The following chart shows which permissions are associated with each ModelMart default security profile. An “X” in a security profile column means the ModelMart permission is granted; a blank means that permission is denied.

Use this chart to determine which permissions are needed to create, modify, or delete objects. For example, to update a column property, such as null option, find the object you want to update in the ModelMart Object column (Column Properties) and then locate the corresponding permission in the ModelMart Permission column (Update Attribute). Accordingly, you must be assigned to a profile that has Update Attribute permission. Similarly, to update the null option in a domain, your security profile must have Update Domain permission.

Permission	ModelMart Object	ModelMart Permission	ModelMart Default Security Profile
Object Class			Admini-strator	Architect	Modeler	Viewer	Guest
ModelMart	Library	Manage ModelMart Create Library Update Library Delete Library	X X X X	X X X
Library	Diagram (ModelMart)	Create Diagram Update Diagram  Delete Diagram	X X X	X X X	X X X
Library	Domain (for example, Domain Name, Datatype, Default Value, Definition, Null Option, Validation Rules)	Create Domain Update Domain Delete Domain	X X X	X X X	X X X
Library	Physical Storage Object (for example, Table Space, Rollback Segment, Oracle Database)	Create Physical Object Update Physical Object Delete Physical Object	X X X	X X X	X X X
	Template (for example, Pre/Post Script, Stored Proc, Trigger)
Diagram	Entity (for example, Entity Name,  Entity Definition, Table Properties)	Create Entity Update Entity Delete Entity	X X X	X X X	X X X
	Relationship (for example, Rolename, Name, Verb Phrase, Cardinality, Type)
	Stored Display, Text Block
Subject Area	Subject Area (Change membership of subject area)	Manage Subject Area Update Diagram	X	X	X
Entity	Attribute (for example, Attribute Properties, Column Properties)	Create Attribute Update Attribute Delete Attribute	X X X	X X X	X X X
Note:	ModelMart implements the five default security profiles as shown above. The Viewer and Guest security profiles are initially assigned no permissions. See Creating and Modifying ModelMart Security Profiles  for more information.

To manage the ModelMart, you must have Manage ModelMart permission on the ModelMart, and you must be the dbo (Microsoft SQL Server or Sybase) or schema owner (Oracle) of the ModelMart database or the INFORMIX DBA.


Summary of ModelMart Default Security Profiles for BPwin

The following chart shows which permissions are associated with each ModelMart default security profile. An “X” in a security profile column means the ModelMart permission is granted; a blank means that permission is denied.

Summary of Permissions Granted in the Default Security Profiles for BPwin

Permission Object Class	ModelMart Object	ModelMart Permission	ModelMart Security Profile
			Administrator	Architect	Modeler	Viewer	Guest
ModelMart	ModelMart	Manage ModelMart Create Library Update Library Delete Library	X X X X	X X X
Library	Library	Create BPModel Update BPModel  Delete BPModel	X X X	X X X	X X X
Note:	ModelMart implements the five default security profiles as shown above. The Viewer and Guest security profiles are initially assigned no permissions. See Creating and Modifying ModelMart Security Profiles  for more information.

To manage the ModelMart, you must have Manage ModelMart permission on the ModelMart, and you must be the dbo (Microsoft SQL Server or Sybase) or schema owner (Oracle) of the ModelMart database or the INFORMIX DBA.


Using Security to Manage Your License Agreement

When you add a ModelMart user, ModelMart automatically counts the number of users to determine if you have exceeded the limits of your license agreement. If you have too many users, a message informs you to remove any users in excess of your license agreement.

Alternatively, if your workgroup includes users who need to view or run reports on ERwin diagrams or BPwin models stored in ModelMart, purchase the Navigator edition of the ModelMart client (such as ERwin/Navigator or BPwin/Navigator) for them and assign them to the default Guest security profile. The Navigator edition is a read-only version of the ModelMart client that you can use to open and print diagrams or models stored in ModelMart and run reports, but you cannot save an ERwin diagram or BPwin model to the ModelMart or to a file. By assigning the users of the Navigator edition of a ModelMart client the Guest security profile, you can provide access to ModelMart information without allocating a valuable license seat.

While you can customize any security profile, do not modify the default Guest security profile. Assign the Guest profile exclusively to Navigator users. You can use the default Viewer security profile to limit the permissions of a user in a particular object class. See Inheriting and Overriding Security Permissions  for more information.

Note:	By default, new ModelMart users are assigned the Guest default security profile if you have not selected a different default security profile or modified the default Guest permissions. However, ModelMart counts a new user as a licensed user until you actually assign the user to the Guest profile in the ModelMart Security Manager. To prevent ModelMart from counting Navigator users, be sure to drag the user icon from the User list to the Guest icon in the Security Profile list.


Maintaining Archives and Versions ModelMart Diagrams

ERwin provides a number of different ways in which you can incrementally save the state of a model so that you can later revert back to that model state if required. The options are as follows:

•	Archives [image]. An archive is a record of the changes made to a model since the model was last saved to the ModelMart. For each ModelMart library, you can select the Auto Archive option. If this option is selected, each time a user saves a model to that library, ERwin creates an archive of that model. See Saving Archives of a ModelMart Diagram  for more information.

•	Versions [image]. A version of a model stored in ModelMart is a record of the state of a model at a particular moment in time. At any time, you can open the ModelMart Version Manager and create a version of a model stored in ModelMart. Unlike an archive, a version of a model stored in ModelMart contains all the model information. See Creating a Version of a ModelMart Diagram  for more information.

•	Combination Archives and Versions. You can create a version of a model stored in ModelMart from any of the existing archives of that model. You can use this features to roll up all the changes stored in several archives into one version. Then, if you want, you can purge the archives for that model. See Creating a Version of a ModelMart Diagram from an Archive  for more information.

Related Topics

  Purging Diagram Archives

  Reverting to an Archive or Version of a ModelMart Diagram


Saving Archives of a ModelMart Diagram

Each ModelMart library has a Auto Archive option. When the Auto Archive option for a library is selected, each time you or another user saves a model to that library, ERwin automatically generates an archive of the model. This feature is useful if you want the ability to revert back to an earlier state of the model. See Managing ModelMart Libraries and Diagrams  for more information.

When you save a model, ERwin displays the Save Model to ModelMart dialog. If the Archive Original Version check box is selected in this dialog, the library into which you are saving the model has the Auto Archive option available.

When you click OK in the Save Model to ModelMart dialog, ERwin automatically creates the archive of the model. The archive contains only the changes made to the model since it was last saved. ERwin assigns a name to an archive of a model according to the following convention:

 <model name>:<user name> on <date>;<archive number>

For example:

 movies.er1: LBAKER on FEB 19,97;12

Since each archive of a model only contains information about the changes made to a model since it was last saved to ModelMart, if you want to revert back to an archive of a model, all intermediate archives of the model must be available.

If the number of archives becomes unmanageable, you can roll up the changes saved in multiple archives into a single version of the model, then purge the archives. See Creating a Version of a ModelMart Diagram from an Archive   for more information.

Related Topics

  To open an archive of a ModelMart diagram


To open an archive of a ModelMart diagram

1.	Click the ModelMart Version Manager button [image] on the ModelMart toolbar.

2.	Click on the archive [image] you want to open in the ModelMart Objects list.

3.	Click the Open button. ERwin opens the archive of the ModelMart diagram.


Creating a Version of a ModelMart Diagram

At any time, you can open the ModelMart Version Manager and create a version of a model. Unlike an archive [image], a model version [image] includes all the model information.

To save a version of a model, open the ModelMart Version Manager, select the ERwin model in ModelMart for which you want to create the version, and click the Version button. ERwin opens the Save ModelMart Version dialog.

You can view all existing versions associated with the current model and the date on which each version was created in the Other ModelMart Model Versions list at the bottom of the dialog. The default name that ERwin assigns to a version is in the format:

 Vn: <model name>

For example:

 V2: movies.er1

If you choose to generate a version from an archive, the <model name> is the full archive name. Accept the default name, or type a new name in the New Version Name box. Optionally, type a description for the version in the Description box, then click OK. ERwin creates the version.

You can also create a version from an archive of a ModelMart model. See Creating a Version of a ModelMart Diagram from an Archive   for more information.

Related Topics

  To create a version of a ModelMart Diagram

  To open a version of a ModelMart diagram


To create a version of a ModelMart diagram

1.	Click the ModelMart Model Differences button [image] on the ModelMart toolbar, or choose ModelMart Version Manager from the ModelMart menu.

2.	Click on the model from which you want to save a version, then click the Version button. ERwin opens the Save ModelMart Version dialog.

3.	Accept or edit the name in the New Version Name box.

4.	Optionally, type a description for the version in the Description box.

5.	Click OK. ERwin creates the new version.


To open a version of a ModelMart diagram

1.	Click the ModelMart Version Manager button [image] on the ModelMart toolbar, or choose ModelMart Version Manager on the ModelMart menu.

2.	Click on the version [image] you want to open in the ModelMart Objects list.

3.	Click the Open button. ERwin opens the version of the ModelMart diagram.


Creating a Version of a ModelMart Diagram from an Archive

You can also create a version [image] of a model from an existing archive [image]. The procedure is the same as creating a version from a full model, except that you select an archive as the source for the version.

When you create a version from an archive, ERwin includes all the information in the original model and all the changes stored in the selected archive and all earlier archives. You can use this feature to roll up changes recorded in multiple archives into a single version of a model, then purge the archives. See Purging Diagram Archives  for more information.

Related Topics

  To create a version of a ModelMart diagram from an archive

  To open a version of a ModelMart diagram


To create a version of a ModelMart diagram from an archive

1.	Click the ModelMart Model Differences button [image] on the ModelMart toolbar, or choose ModelMart Version Manager from the ModelMart menu.

2.	Click on the archive [image] from which you want to save a version, then click the Version button. ERwin opens the Save ModelMart Version dialog.

3.	Accept or edit the name in the New Version Name box.

4.	Optionally, type a description for the version in the Description box.

5.	Click OK. ERwin creates the new version [image].


Purging Diagram Archives

The Version Manager provides the option to purge the archives of a ERwin model stored in ModelMart. If the number of archives becomes unmanageable, you can select an archive then click the Purge button to delete the archive and all earlier archives. Before you purge the archives of a model, consider generating a model version from an archive to roll up all the changes recorded in the archive and all previous archives. Then you can revert back to the created version of the model if necessary. See Creating a Version of a ModelMart Diagram from an Archive  for more information.

Related Topics

  To purge archives of a ModelMart Diagram


To purge archives of a ModelMart diagram

1.	Click the ModelMart Model Differences button [image] on the ModelMart toolbar, or choose ModelMart Version Manager from the ModelMart menu.

2.	Select an archive [image] of a ERwin model in ModelMart.

3.	Click the Purge button.

4.	ERwin displays a message indicating that all earlier archives will be deleted and asks you to confirm the deletion. Choose one of the following options:

•	Yes. To delete the selected archive and all earlier archives.

•	No. To cancel the purge operation.


Reverting to an Archive or Version of a ModelMart Diagram

If you want to roll back all changes to a model to a specific moment in time, you can revert to any archive [image] or version [image] saved in the ModelMart library.

Using the archive record that ModelMart maintains for a model, you can compare the changes made in different versions and revert back to an earlier archive of a model.

You can also use a version of a ERwin model stored in ModelMart to compare differences with the parent model, other versions, or archives of that model. Also, you can revert back to the state of the model when the version was saved to the ModelMart.

To roll back changes made to the ModelMart, choose ModelMart Version Manager on the ModelMart menu and open the archive or version to which you want to revert.

Then, choose ModelMart Save As on the ModelMart menu, select the library that contains the parent model, and save the archive or version as the parent model. When you click OK, ERwin asks if you want to replace the parent model with the selected archive or version. Click Yes to overwrite the model with the archive or version or click No to cancel.

Related Topics

  To revert to an archive or version of a ModelMart diagram


To revert to an archive or version of a ModelMart diagram

1.	Click the ModelMart Model Differences [image] button on the ModelMart toolbar, or choose ModelMart Version Manager on the ModelMart menu.

2.	Double-click on the library that contains the model archive [image] or version [image] that you want to open in the ModelMart Objects list.

3.	Click on the model archive or version you want, then click Open. ERwin opens the archive or version in the model window in read-only mode.

4.	Choose ModelMart Save As on the ModelMart menu. ERwin displays the Save ModelMart Model As dialog.

5.	Click on the library that contains the model you want to replace in the ModelMart Library dialog.

6.	Click on the model that you want to replace in the ModelMart Model list and click OK. ERwin asks if you want to replace the existing document with the archive or version that you are saving.

7.	Click Yes. ERwin updates the model based on the information in the archive or version.

Note:	To compare an archive or version with another archive, version, or the parent model, choose the ModelMart Version Differences option on the ModelMart menu. ERwin displays the differences. You can selectively undo changes saved in the parent model or roll back to an earlier version. See Comparing Different ModelMart Diagram Archives or Versions  for more information.


Controlling Changes Made to ModelMart Diagrams

When multiple users work on the same data model, special attention must be paid to controlling how the changes of different users are merged so that conflicts are minimized and updates made to the ModelMart are not inadvertently overwritten.

Because organizations have different sized workgroups, data models, and concurrency requirements, each team can partition their modeling work and set up the diagram locking guidelines and security profiles that work best in their environment. Establishing basic guidelines about locking diagrams, saving changes to the ModelMart, resolving conflicts, and so on, can be handled by the ModelMart Administrator, the lead modeler, or by mutual agreement within the workgroup. See Using ModelMart Security Features  for information about using ModelMart security profiles to control changes and minimize diagram conflicts.

Related Topics

  Using the ModelMart Change Control Manager


Using the ModelMart Change Control Manager

The ModelMart Change Control Manager is displayed when you:

•	Review changes you have made to a ModelMart diagram.

•	Resolve conflicts between the changes you have made to your copy of a ModelMart diagram and changes already saved to the master version of the diagram stored in ModelMart.

•	Refresh your copy of a ModelMart diagram with changes made to the master version in ModelMart.

•	Compare two diagrams.

•	Merge two diagrams.

The ModelMart Change Control Manager dialog is divided into two main areas as follows:

•	Toolbar. The toolbar provides shortcuts that help you work with a change list.

•	Change List. The change list area contains a one-panel or two-panel list that uses a common set of symbols and keywords to represent the changes that were made to a diagram since you opened it.

Related Topics

  Working with Change Lists

  ModelMart Change Control Manager Toolbar


ModelMart Change Control Manager Toolbar Buttons and Menu Options

The ModelMart Change Control Manager functions are accessible through a toolbar bar and a menu bar. The following chart briefly describes the purpose of each toolbar button, identifies the menu option that performs the same function (if available), and explains where to get more information.

Button	Menu	Option	Select This Option/Button to:
	File	Apply to ModelMart	Commit the changes in the currently displayed change list to the master diagram in ModelMart.
	File	Exit	Cancel the process of reviewing changes or resolving conflicts.
	File	Save Local…	Open the ERwin Save As dialog in which you can save the current state of the open model to an .er1 file. See Saving the Current State of a ModelMart Diagram to an .er1 File  for more information.
	File	Report…	Open the Report Browser and generate a report on the currently displayed change list.
	Edit	Toggle Selected Changes	Change the status (canceled or accepted) of the currently selected changes. See Canceling Changes in a Change List  for more information.
	Edit	Find in Script	Specify the search criteria for an item you want to find in a change list and find the first item that matches the search criteria you specify. See Finding Items in a Change List  for more information.
	Edit	Find Next in Script	Find the next item in a change list that matches the current search criteria. See Finding Items in a Change List  for more information.
	Edit	Filter Text…	Displays the currently selected filters that are used when finding one or more items in a change list. See Viewing the Currently Selected Search Criteria  for more information.
	View	Info Window…	Display details about the currently selected change. If multiple items are selected, the information displayed relates to the first item in the selection. The detail information includes hot links to related changes. See Viewing Information About a Change in a Change List  for more information.
	View	Details	Display or hide detail-level changes. A detail-level change is a change that is the result of another change. See Filtering a Change List  for more information.
	View	Graphical Changes	Display or hide graphical changes. A graphical change is a change to the visual appearance of a diagram, such as repositioning an entity or a relationship line. See Filtering a Change List  for more information.
	View	Conflicts Only	Display conflicting changes only. A conflicting change is a change that you want to save to a ModelMart diagram that directly conflicts with a change already saved to the ModelMart by another user since you opened the ModelMart diagram. See Filtering a Change List  for more information.
	Help	About	Displays the current version of the ModelMart Change Control Manager.
Related Topics

  Working with Change Lists


Working with Change Lists

A change list in the ModelMart Change Control Manager is similar to a transaction log. It provides a record of the proposed changes or the changes already saved to master diagram in ModelMart.

When you choose to review or save your changes to a ModelMart diagram and no other user has made changes since you opened the diagram from ModelMart, the ModelMart Change Control Manager dialog displays a single-panel change list. Click here for an example.

When you compare your changes with the changes made by others, compare two diagram versions, or merge two independent diagrams, the ModelMart Change Control Manager displays a two-panel list. Conflicting changes in the change list are aligned horizontally. Conflicting changes in the change lists are aligned horizontally. Click here for an example.

Using the toolbar buttons you can:

•	Filter a change list

•	Cancel changes in a change list

•	Find items in a change list

•	View the currently selected search criteria

•	View information about a change statement in a change list

•	Save the current state of a diagram as an .ER1 file

•	Generate a report on the change list information

Related Topics

  Summary of ModelMart Change List Symbols and Keywords


Summary of ModelMart Change List Symbols and Keywords

In each list in the ModelMart Change Control Manager dialog, ERwin uses special symbols such as a plus sign, a minus sign, and arrows, combined with a transaction statement, to express a specific change made to a diagram. The statements and symbols used in a change list are summarized below.

Symbol/ Keyword	Displayed When You...	Example
Create	Create an object (for example, an attribute). or Cause ERwin to automatically add a detail object (for example, a foreign key).	Create attribute CUSTOMER, customer-status  Create attribute CUSTOMER, store-id
Add	Add an object to a Subject Area.	Add entity CUSTOMER to Acct Subject Area
Set or Update	Move an object.	Set entity CUSTOMER rectangle feature to 147, 124, 310, 240 in Main Subject Area, Display 1
Clear	Reset diagram object to default values.	Clear Validation Rule STATE ‘Min Value’ property
Define	Use a new color for the first time in a diagram.	Define color 'RGB 255/0/0'
Delete	Delete an object (for example, an entity). or Cause ERwin to automatically delete an object.	Delete entity CUSTOMER  Delete attribute CUSTOMER, customer status
Cancel	Double-click on an item in the Change list to cancel your change.	Delete attribute CUSTOMER, customer status
Prohibited	Try to update or delete an object in a diagram for which you do not have permission.	Delete entity CUSTOMER (When you click OK in the ModelMart Change Control Manager, ERwin discards the prohibited operation.)
	Reposition an object in a diagram.	Set Entity MOVIE ‘Rectangle’ feature to 541, 9, 636, 173 in <Main Subject Area>/Logical Model.
	Make a change to a text item such as a definition or comment in a change list.	A unique ID identifying a movie copy.
Note:	If you rename an attribute using the Attribute Editor for example, ERwin displays a create statement to express the addition of the new name (such as, Create attribute customer-name) and a delete statement to express the removal of the old name (such as, Delete attribute cust-name).

Related Topics

  Filtering a Change List


Filtering a Change List

You can filter a change list in the ModelMart Change Control Manager using one or more of the following toolbar buttons:

•	 Show Details. Click this button to display or hide detail-level changes. When you update a diagram, some of your changes may result in additional automatic changes to your diagram. For example, if you create a relationship between two entities, ERwin automatically adds the appropriate foreign key to the child entity. In a change list, the automatic changes are considered detail-level changes. See Detail-Level Diagram Changes Example  for more information.

•	 Show Graphical Changes. Click this button to display or hide graphical changes. In a change list, a graphical change statement is displayed when you reposition or move a diagram object, for example, when you reposition an entity.

•	 Show Conflicts Only. Click this button to display only conflicting changes in the change list; all non-conflicting change statements are hidden. During conflict resolution, the ModelMart Change Control Manager dialogs display a two-panel change list with conflicting changes horizontally aligned. For example, if your change conflicts with a change already saved to the ModelMart by another user, your change is displayed directly opposite the conflicting change.

Related Topics

  Working with Change Lists


top-level change

Changes that you or another user makes to a ModelMart diagram. For example, creating a relationship between two entities.


detail-level change

Additional changes that ERwin automatically applies when you make a change to a ModelMart diagram. For example, when you draw a relationship between two entities, ERwin automatically creates the foreign key attribute in the child entity.


Detail-Level Diagram Changes Example

The following table shows the type of detail changes ERwin makes if you add a new entity named STORE (with a primary key store-id) to the MOVIES sample diagram and create an identifying relationship is rented from between STORE and MOVIE-RENTAL-RECORD entities.

ERwin automatically applies these changes…	In order to…
Create attribute MOVIE-RENTAL-RECORD, store-id Create attribute OVERDUE-NOTICE, store-id Create attribute INVOLVEMENT-RECORD, store-id	Migrate the primary key store-id as a foreign key throughout the diagram.
Create domain NOT NULL for attribute INVOLVEMENT-RECORD, store-id Create domain NOT NULL for attribute INVOLVEMENT-RECORD, store-id Create domain NOT NULL for attribute INVOLVEMENT-RECORD, store-id	Assign a domain to each instance of the new store-id attribute.
Create column in table OVERDUE-NOTICE over domain NOT NULL Create column in table MOVIE-RENTAL over domain NOT NULL Create column in table INVOLVEMENT-RECORD over domain NOT NULL	Create a new column in each table in which the primary key migrates as a foreign key.
Create Foreign Key index X1F8MOVIE_RENTAL_RECORD on table MOVIE_RENTAL_RECORD	Create a foreign key index in the entity MOVIE-RENTAL-RECORD.
Add column OVERDUE_ NOTICE to index XPKOVERDUE_NOTICE on table OVERDUE_NOTICE Add column OVERDUE_ NOTICE to index X1F7OVERDUE_NOTICE on table OVERDUE_NOTICE Add column MOVIE_RENTAL_RECORD to index XPKOVERDUE_NOTICE on table MOVIE_RENTAL_RECORD Add column MOVIE_RENTAL_RECORD to index X1F8OVERDUE_NOTICE on table MOVIE_RENTAL_RECORD Add column INVOLVEMENT_RECORD to index XPKOVERDUE_NOTICE on table INVOLVEMENT_RECORD Add column INVOLVEMENT_RECORD to index X1F5OVERDUE_NOTICE on table INVOLVEMENT_RECORD	Add columns to the index for each table in which the primary key migrates as a foreign key.


Canceling Changes in a Change List

In a change list, changes shown in black are changes that will be saved to the ModelMart when you click the Continue button [image] on the toolbar. Changes shown in red are changes that will not be saved to the ModelMart.

You can change the status (canceled or accepted) of each top-level change in the change list. A top-level change is a change that is not the result of any other change. When you change the status of a top-level change, the status of all related detail-level changes are changed accordingly. Changes that are not top-level changes are always unavailable (dimmed).

You can use SHIFT+click or CTRL+click to select multiple change statements in a change list, then click the Toggle button to change the status of all the items collectively. This feature is particularly useful when working with long change lists.

Related Topics

  To cancel changes in a change list

  Working with Change Lists


To cancel changes in a change list

1.	Review the change list and decide which changes you want to save or cancel.

2.	Use one of the following methods to cancel the changes that you do not want to save to ModelMart:

•	Double-click on a top-level change statement.

•	Right-click on a top-level change statement and choose Toggle from the shortcut menu.

•	Use SHIFT+click and CTRL+click to select multiple, top-level changes in the change list, then click the Toggle button [image].

When you apply the methods above, accepted changes (black) are canceled (red), and canceled changes (red) become accepted (black). If you change your mind, you can repeat the action above to reverse the change.

3.	Click the Continue button [image]. The changes marked in black are committed to the master diagram in ModelMart and the changes marked in red are discarded.


Finding Items in a Change List

The ModelMart Change Control Manager includes a search feature that you can use to quickly find information in a change list.

The find feature uses the fact that each change item has a format similar to that shown in the figure below. You can enter search criteria for one or more of the components of a change item.

When you click the Find in Script button [image] in the ModelMart Change Control Manager toolbar, the ModelMart Find in Script dialog is displayed. The ModelMart Find in Script dialog contains five tabs in which you can specify search conditions for the various components of a change statement in a change list. Each tab corresponds with one of the five change item components identified in the figure above.

By specifying search criteria in many different tabs, you can customize your search criteria to find the most specific list of items in the change list. When you start the search, all change statements that match the search criteria are marked found by the match symbol ( [image]).

You can click the Find First or Find All buttons to begin the search. If you click the Find First button, the name of the button changes to Find Next after the first match so that you can search for subsequent match items.

There are also two generic options in the ModelMart Find in Script dialog:

•	Hide Unmatched. Select this check box to hide all items that do not match the search criteria. When you select this option, you must use the Find All button. The Find First button is unavailable (dimmed) in this context.

•	Select Matched. Select this check box to have matched items selected (highlighted). If you click the Find All button with this option selected, all matched items are highlighted. This option is useful if you want to toggle a set of related change statements.

Related Topics

  Specifying Search Criteria for a Change Statement Component

  Working with Change Lists


Specifying Search Criteria for a Change Item Component

You can specify search conditions for a specific change statement component in the corresponding tab in the ModelMart Find in Script dialog:

•	Type. Select the types of change that you want to find in the current change list. For example, find all change statements with the Create type.

•	Class. Select the classes that you want to find in the current change list. For example, find all change statements that apply to the Entity class.

•	Subject Area. Select the subject areas that you want to find in the change list. For example, find all change statements that apply to the <Main Subject Area>.

•	Object. Select the objects that you want to find in the current change list. For example, find all change statements that apply to the STORE.store-number object.

•	Property. Select the properties that you want to find in the current change list. For example, find all change statements that include the Rectangle property.

Each tab contains the following controls which you use to set the search criteria:

•	List of possible change statements. This list shows the items you can search for in the current change list. For example, the Class tab shows a list of all classes referenced in the change list. You can select a class, or multiple classes (using SHIFT+click or CTRL+click) to find items in the change list that reference one of the selected classes.

•	Find non-matches. Select this box to find items in the change list that match one of the unselected items in the list above. In the Filter dialog, this condition is identified by the letters NE which stands for “not equal to”.

•	Cancel. Click this button to clear all items selected in the list above.

Note:	An asterisk (*) is displayed next to the tab label when the tab contributes to the current search criteria. When you click the Cancel button, the asterisk next to the tab label is removed indicating that it no longer contributes to the search criteria.

Related Topics

  To find an item in a change list


To find an item in a change list

1.	Click the Find in Script button [image].

2.	Choose one or more of the following:

•	To search for one or more change statements of a specific type, for example Create, click the Type tab, then select one or more of the types you want to find in the Type list box.

•	To search for one or more change statements that apply to a specific class, for example Entity, click the Class tab, then select one or more of the classes you want to find in the Classes list box.

•	To search for one or more change statements that apply to a specific subject area, for example the <Main Subject Area>, click the Subject Area tab, then select one or more subject area from the Subject Area list box.

•	To search for one or more change statements that apply to a specific object, for example the STORE.store-id object, click the Object tab, then select one or more object from the Object list box.

•	To search for one or more change statements that apply to a specific property, for example the ‘Rectangle’ feature property, click the Property tab, then select one or more properties in the Property list box.

3.	Choose one of the following:

•	To find the first item in the change list that matches the criteria you have specified in the tabs, click the Find First button. The button name changes to Find Next after the first change statement match.

•	To find and mark all the items in the change list that match the criteria you have specified in the tabs, click the Find All button.

Matched items are marked with the match symbol ( [image]) which is displayed to the left of the change statement in the change list.

Note:	In Step 2 above, on each tab you can select the Find Non-matches check box to search for the unselected items in the list box on the respective tab.


Viewing the Currently Selected Search Criteria

Once you specify the search conditions, you can use the Filter Text [image] button to view the currently selected search conditions in the Filter dialog.

Each line in the filter dialog corresponds to a search condition defined on one of the tabs in the ModelMart Find in Script dialog.

If you change any of the search conditions while the Filter dialog is displayed, the Filter dialog is automatically updated.

If your search includes more than one component, the letters OR appear between the components in the Filter dialog. If you select the Find non-matches check box in a tab, the letters NE denoting “not equal to” appear next to the selected component in the line corresponding to that tab.

Related Topics

  To view the currently selected search criteria

  Working with Change Lists


To view the currently selected search criteria

•	Click the Filter Text button [image] on the Change Control Manager toolbar. ModelMart opens the Filter dialog which shows the currently selected search criteria.

Note:	In the Filter dialog, OR denotes search criteria including more than one change component.

NE denotes “not equal to” meaning that the search includes all components except the component labeled NE.


Viewing Information About a Change Statement in a Change List

In a single-panel change list, when you right-click on a change statement and choose More Information from the shortcut menu, the ModelMart Change Information dialog shows a two-column list:

•	The first column shows the properties of the change statement.

•	The second column shows the value of each property.

Click here for an example.

In a two-panel change list, when you right-click on a change statement and choose More Information from the shortcut menu, the ModelMart Change Information dialog shows a three column list:

•	The first column shows the properties of the change statement.

•	The second column shows the value of each property in your copy of the ModelMart diagram.

•	The third column shows the value of each property in the master version of the diagram in ModelMart.

 Click here for an example.

While the ModelMart Change Information dialog is displayed, you can click any change in the Change List and the ModelMart Change Information dialog is updated to reflect the selected change.

If the change item you select is a detailed-level change, a Parents property is displayed in the property list. The value of the Parent property is a hot link to the change that caused the detail-level change. Similarly, if the change item you select is a top-level change that causes other changes in the change list, a Children property is displayed in the property list. The value of the Children property is one or more hot links to related child change statements.

Note:	To display information about an item in a change list, you can also click on the change item to select it, then click the Open Info Window button [image] on the ModelMart Change Control Manager toolbar.

Related Topics

  To view information about a change in a change list

  Working with Change Lists


To view information about a change statement in a change list
To view information about a change in a change list

•	Choose one of the following:

•	Select the change statement, then click the Open Info Window button [image].

•	Right-click on the change statement and choose More Information from the shortcut menu.


Saving the Current State of a ModelMart Diagram to an ER1 File

While you are working with the ModelMart Change Control Manager, you can save the current state of a ModelMart diagram as an .er1 file. When you choose this option, the diagram you save includes the changes specified in the change list. This feature is useful if you choose not to save your changes to the ModelMart at this time. You can keep your changes in an .er1 file, then use the .er1 file to merge your changes back to the master diagram in ModelMart at a later time.

Related Topics

  To save the current state of a ModelMart diagram to an ER1 file


To save the current state of a ModelMart diagram to an ER1 file

1.	Click the Save Updated Model in ER1 file button [image] on the ModelMart Change Control Manager toolbar. The ERwin Save As dialog is displayed.

2.	Type a file name, select a folder, and click OK.


Reviewing ModelMart Changes

If you make changes to a ModelMart diagram, you can choose the ModelMart Change Control Manager option on the ModelMart menu to review your changes to the ModelMart diagram. ERwin displays the ModelMart Change Control Manager - Review Changes dialog which list the changes you have made.

You can only review your ModelMart diagram changes in this context; you cannot save your changes. When you click the Continue button [image], ERwin closes the ModelMart Change Control Manager dialog, but does not save your changes to the ModelMart diagram. When you are ready to save your changes, choose Save to ModelMart from the ModelMart menu. See Reviewing Changes When Saving a Diagram to the ModelMart  for more information.

When reviewing your changes to a ModelMart diagram, you can:

•	Filter the change list.

•	Find one or more items in the change list.

•	View information about a change in a change list.

•	Change the status (accepted or canceled) of changes in the change list.

•	Generate a report on the change list information.

Related Topics

  To review changes to a ModelMart diagram


To review changes to a ModelMart diagram

1.	Click the Review Changes to ModelMart diagram button [image] on the ModelMart toolbar or choose ModelMart Change Control Manager on the ModelMart menu. ERwin opens the ModelMart Change Control Manager dialog.

2.	Choose one or more of the following while reviewing the change list:

•	To display or hide detail-level changes (such as a foreign key attribute), click the Show Details button [image].

•	To display or hide graphical changes (such as the new position of an entity) click the Show Graphical Changes button [image].

•	To specify search criteria that you want to use to find one or more change statements in the change list, click the Find in Script button [image]. More>>

•	To display detailed information about a change statement, select the item in the change list, then click the ModelMart Change Information button [image]. More>>

•	To undo or redo the selected top-level change, click the Toggle button [image]. You can also use SHIFT+click or CTRL+click to undo and redo multiple changes simultaneously.

•	To generate a report on the change list information, click the Report Browser button [image]. More>>.

3.	Click the Continue button [image]. ERwin closes the ModelMart Change Control Manager - Review Changes dialog.

Note:	Changes are not saved to the ModelMart in this context. If you want to save your changes, see Reviewing Changes When Saving a Diagram to the ModelMart  for more information.

If you change any library objects, such as domains, validation rules, or trigger templates, a library-level change list is displayed before the diagram-level change list. After you review the library-level change list, you can click the Continue button [image] to display the diagram-level change list.


Reviewing Changes When Saving a Diagram to the ModelMart

When you make changes to a ModelMart diagram then choose the Save to ModelMart option on the ModelMart menu, ERwin gives you the option to review your changes before saving them to the ModelMart. If you choose to review your changes, ERwin displays a ModelMart Change Control Manager - Review Changes dialog. If changes by other users have already been saved to the ModelMart diagram since you opened it from ModelMart, ERwin displays the ModelMart Change Control Manager - Resolve Conflicts dialog. See Resolving ModelMart Change Conflicts  for more information.

In a ModelMart Change Control Manager - Review Changes dialog, you can:

•	Filter the change list.

•	Find one or more items in the change list.

•	View information about a change in a change list.

•	Change the status (accepted or canceled) of changes in the change list.

•	Generate a report on the change list information.

When you are ready to save your changes to the ModelMart, click the Continue button [image]. Changes shown in black are saved to the ModelMart and changes shown in red are discarded.

At any time, you can review your changes to a ModelMart diagram without an intention to save changes at that time. See Reviewing ModelMart Changes  for more information.

Note:	If you are assigned the Administrator security profile, you can open the ModelMart Security Manager dialog and update ModelMart profiles and user permissions. When you close the dialog, ERwin opens the ModelMart Change Control Manager dialog so that you can review, save, and cancel your changes. Security profile changes are treated in the same way as diagram changes.

Related Topics

  To review changes when saving a diagram to the ModelMart


To review changes when saving a diagram to the ModelMart

1.	Click the Save ModelMart diagram button [image] on the ModelMart toolbar or choose Save to ModelMart on the ModelMart menu. ERwin opens the Save Diagram to ModelMart dialog.

2.	Select the Review All Changes Before Save check box.

3.	Click OK. ERwin opens the ModelMart Change Control Manager - Review Changes dialog, so that you can review and confirm your changes.

4.	Choose one or more of the following while reviewing the change list:

•	To display or hide detail-level changes (such as a foreign key attribute), click the Show Details button [image].

•	To display or hide graphical changes (such as the new position of an entity) click the Show Graphical Changes button [image].

•	To specify search criteria that you want to use to find one or more change statements in the change list, click the Find in Script button [image]. More>>

•	To display detailed information about a change statement, select the item in the change list, then click the ModelMart Change Information button [image]. More>>

•	To undo or redo the selected top-level change, click the Toggle button [image]. You can also use SHIFT+click or CTRL+click to undo and redo multiple changes simultaneously.

•	To generate a report on the change list information, click the Report Browser button [image]. More>>.

5.	When you are ready to save the changes to the ModelMart, click the Continue button [image]. ERwin saves all the uncanceled (black) changes to the master copy in the ModelMart.

Note:	If you change any library objects (such as domains or physical objects), ERwin displays the library-level changes in the Change Control Manager - Review Changes dialog before displaying the diagram-level changes. See Understanding ModelMart Libraries   for more information.

In addition to reviewing your changes when you save a diagram to the ModelMart, you can also choose the ModelMart Change Control Manager option on the ModelMart menu to review your changes before you save your diagram. See Reviewing ModelMart Changes  for more information.


Resolving ModelMart Change Conflicts

Whenever you try to save your changes back to the ModelMart, if any of your changes conflict with a change previously saved to the ModelMart by another user, ERwin opens the ModelMart Change Control Manager - Conflict Resolution dialog. In the Conflict Resolution dialog, you can compare conflicting changes and decide to keep the changes that were previously saved to the ModelMart or overwrite them by saving your own changes back to the ModelMart.

The change list in the left pane shows the changes you have made in your copy of the diagram. The change list in the right pane shows the changes already saved to the ModelMart by other users since you opened your copy of the diagram. If one of your changes is in conflict with a change already saved to the ModelMart by another user, your change and the corresponding conflicting change are aligned horizontally.

By default, ERwin automatically saves all your non-conflicting (black text) changes and discards all of your conflicting changes (red text) when you click the Continue button. To save a change shown in red text to the ModelMart, double-click on it. ERwin changes the text from red to black and when you click the Continue button, saves you change to the ModelMart master version. When there is a conflict and you double-click on your change to save it, ERwin saves your change and overwrites the corresponding change made by another user.

Using the features of the ModelMart Change Control Manager, you can:

•	Filter the change list.

•	Find one or more items in the change list.

•	View information about a change in a change list.

•	Change the status (accepted or canceled) of changes in a change list.

•	Generate a report on the change list information.

When the change list in the left pane shows the changes you want to apply to the master diagram in ModelMart, click the Continue [image] button. ERwin opens the Change Control Manager - Review Changes dialog with your approved changes shown in a single list. If you want, you can use the features of the Change Control Manager to review the changes again.

Click the Continue button [image] when you finish reviewing your changes. ERwin opens the ModelMart Change Control Manager - Review Changes dialog with your approved changes shown in a single change list.

Click the Continue button [image] again when you are ready to save the diagram to ModelMart. The changes in the change list are committed to the ModelMart.

Note:	If you previously saved a diagram as an .er1 file to work offline and you are merging back you changes to the master diagram in ModelMart, ERwin prompts you to delete the snapshot taken when you saved the .er1 file. Click Yes to delete the snapshot or No to keep it.

Related Topics

  To resolve ModelMart change conflicts


To resolve ModelMart change conflicts

1.	Choose one of the following:

•	Click the Review Changes to ModelMart diagram button [image] on the ModelMart toolbar or choose ModelMart Change Control Manager on the ModelMart menu.

•	Choose Save to ModelMart on the ModelMart menu then select the Review All Changes Before Save check box in the Save to ModelMart dialog and click OK. If there are conflicts between your changes and changes already saved to ModelMart, ERwin opens the ModelMart Change Control Manager - Conflict Resolution dialog.

2.	Compare the changes in the left pane and right pane and choose the changes you want to save or cancel. By default, ERwin cancels all your changes that conflict and saves all your changes that do not conflict with the master version of the model.

3.	Optionally, choose one or more of the following while comparing the changes in both lists:

•	To display conflicting changes only, click the Show Conflicts button [image].

•	To display or hide detail-level changes (such as a foreign key attribute), click the Show Details button [image].

•	To display or hide graphical changes (such as the new position of an entity) click the Show Graphical Changes button [image].

•	To display detailed information about a change statement, select the item in the change list, then click the ModelMart Change Information button [image]. More>>

•	To specify search criteria that you want to use to find one or more change statements in the change list, click the Find in Script button [image]. More>>

•	To undo or redo the selected top-level change, click the Toggle button [image]. You can also use SHIFT+click or CTRL+click to undo and redo multiple changes simultaneously.

•	To generate a report on the change list information, click the Report Browser button [image]. More>>.

4.	Click the Continue button [image] when you finish reviewing the change statements. ERwin opens the Review Changes dialog with one change list showing the approved changes. You can review the approved changes that you are about to commit to the ModelMart. More>>

5.	Click the Continue button [image] when you are ready to save the changes to the ModelMart. ERwin locks the diagram while saving the changes to the ModelMart.

Note:	If you change any library objects (such as domains, validation rules, and trigger templates), and your changes conflict with another user’s changes to the library, ERwin displays the library-level changes in the ModelMart Change Control Manager dialog before it shows you the diagram-level changes.

If you previously saved the diagram as an .er1 file to work offline and you are merging back your changes to the master diagram in ModelMart, ERwin prompts you to delete the snapshot taken when you saved the .er1 file. Click Yes to delete the snapshot or No to keep it.


Refreshing a ModelMart Diagram

While you are working on an unlocked copy of a ModelMart diagram, other users can save changes to the ModelMart master version. You can refresh your diagram with the changes made by others so that you always have the most current information.

To refresh your diagram copy with changes made to the ModelMart master version, choose ModelMart Refresh Manager on the ModelMart menu. The action ERwin takes depends on certain conditions as follows:

•	If there are no differences between your diagram copy and the master diagram in the ModelMart, ERwin informs you that your diagram copy is current (up-to-date).

•	If changes have been made to the master diagram in the ModelMart, ERwin opens the ModelMart Change Control Manager - Refresh Client dialog with a single change list. The change list shows the changes that have been made to the master diagram that are not in your diagram copy.

•	If you have made changes that are in conflict with changes that have been saved to the master diagram in the ModelMart, ERwin opens the ModelMart Change Control Manager - Refresh Client dialog with two change lists. The conflicting changes are horizontally aligned in the change lists.

By default, on refresh, ERwin does not import any changes to your copy of a diagram that are in conflict with changes in the master version of the diagram in ModelMart. To import a change in the ModelMart master version that conflicts with changes in your diagram copy, double-click on your change in the left pane to change it from black to red (that is, to cancel your change).

Using the features of the ModelMart Change Control Manager, you can:

•	Filter the change list.

•	Find one or more items in the change list.

•	View information about a change in a change list.

•	Change the status (accepted or canceled) of changes in a change list.

•	Generate a report on the change list information.

Click the Continue button [image] when you are ready to refresh your diagram. ERwin refreshes your copy of the diagram with the server changes that are black in the right pane. If none of the changes to the ModelMart master version conflict with changes to your diagram copy, ERwin imports all changes from the ModelMart master version to your diagram copy.

Related Topics

  To refresh your copy with changes saved to the ModelMart diagram


To refresh your copy with changes saved to the ModelMart diagram

1.	Click the Refresh ModelMart Diagram button [image] on the ModelMart toolbar or choose ModelMart Refresh Manager on the ModelMart menu. ERwin opens the ModelMart Change Control Manager - Refresh Client dialog.

2.	Optionally, choose one or more of the following while identifying the changes you want to import into your copy of the model:

•	To import a change that conflicts with your model copy, double-click on your change statement in the left pane to change the text from black to red. ERwin cancels your action (now displayed in red text) and imports the change from ModelMart when it refreshes your model. Use SHIFT+click or CTRL+click and the Toggle button [image] to change the status of multiple changes simultaneously. More>>

•	To display conflicting changes only, click the Show Conflicts button [image].

•	To display or hide detail-level changes (such as a foreign key attribute), click the Show Details button [image].

•	To display or hide graphical changes (such as the new position of an entity) click the Show Graphical Changes button [image].

•	To display detailed information about a change statement, select the item in the change list, then click the Open Info Window button [image]. More>>

•	To specify search criteria that you want to use to find one or more change statements in the change list, click the Find in Script button [image]. More>>

•	To generate a report from the change list information, click the Report Browser button [image]. More>>.

3.	Click Continue button [image] when the change list in the right pane shows the changes you want to import into your copy of the model. ERwin automatically imports all non-conflicting changes and all conflicting changes that you canceled in favor of the changes already saved to ModelMart.


Comparing Different ModelMart Diagram Archives or Versions

In ERwin, you can save multiple archives or versions of a diagram to help you keep a record of all the changes made to the diagram. ERwin automatically links each archive to the parent diagram. Each version represents the state of the diagram when the version was saved. At any time, you can close the master diagram and compare the current contents of the master diagram with a related archive or version and partially or completely reverse changes made to the newer version.

When you choose ModelMart Version Manager on the ModelMart menu, ERwin opens the ModelMart Version Manager dialog and displays a hierarchical listing of all the libraries, diagrams, related archives, related versions, and snapshots in the ModelMart.

To compare an archive or version to the parent diagram, select the parent diagram then use CTRL+click to select the archive or version that you want to compare from the ModelMart Objects list and click the Diff button.

Note:	You can also use the ModelMart Version Manager to compare a snapshot with any archive or version of the same diagram. However, changes cannot be saved to an archive, version, or snapshot, because they are read-only.

When you click the Diff button, ERwin opens the ModelMart Change Control Manager - Version Differences dialog and displays all the changes made to the diagram since the archive or version was created.

Using the features of the ModelMart Change Control Manager, you can:

•	Filter the change list.

•	Find one or more items in the change list.

•	View information about a change in a change list.

•	Change the status (accepted or canceled) of changes in the change list.

•	Generate a report on the change list information.

The change list in the Version Differences dialog displays the differences between the current state of the diagram and the state of the diagram when the archive or version was saved. As in other ModelMart Change Control dialogs, you can cancel changes. When you cancel a change in the change list, BPwin uses information in the archive or version to overwrite the corresponding data in the parent model.

When you click the Continue button [image], ERwin opens the Save Diagram to the ModelMart dialog so that you can review your changes and save your changes in the parent diagram. See Saving a Diagram to the ModelMart for more information.

Note:	Archives, versions, and snapshots are read-only. You cannot modify an archive, version, or snapshot diagram unless you first save it as a ModelMart diagram under another name. See Saving a ModelMart Diagram under Another Name  for more information.

You can purge unwanted archives and delete versions or snapshots using the ModelMart Version Manager dialog. See Maintaining Archives and Versions of ModelMart Diagrams for more information.

Related Topics

  To compare a diagram with an archive or version and cancel changes


To compare a diagram with an archive or version and cancel changes

1.	Click the Model Version Manager button [image] on the ModelMart toolbar or choose ModelMart Version Manager from the ModelMart menu. ERwin opens the ModelMart Version Manager dialog.

2.	Click on the parent diagram [image] (indented one level below the library name), then hold down the CTRL key and click on a related archive [image] or version [image] (indented one level below the parent diagram), then click the Diff button. ERwin opens the Version Differences dialog.

3.	Optionally, choose one or more of the following when comparing a model to an archive or version of that model:

•	To reverse (undo) a change made to the parent model and replace it with the corresponding data from the selected archive or version, double-click on the change in the change list. BPwin changes the color of the change text from black to red. Use SHIFT+click or CTRL+click and the Toggle button [image] to change the status of multiple changes simultaneously. More>>

•	To display or hide detail-level changes (such as a foreign key attribute), click the Show Details button [image].

•	To display or hide graphical changes (such as the new position of an entity) click the Show Graphical Changes button [image].

•	To display detailed information about a change statement, select the item in the change list, then click the ModelMart Change Information button [image]. More>>

•	To specify search criteria that you want to use to find one or more change statements in the change list, click the Find in Script button [image]. More>>

•	To generate a report on the change list information, click the Report Browser button [image]. More>>.

4.	When you finish comparing the diagrams, click the Continue button [image]. If you canceled a change, ERwin opens the Save Diagram to the ModelMart dialog.

5.	If you want to review the changes again, select the Review All Changes Before Save check box.

6.	Click the Continue button [image] again. ERwin first displays the appropriate dialogs for the options you selected and then updates the parent diagram using the corresponding data from the archive or version.

Note:	If another user locks the ModelMart master version of a diagram, you cannot roll back changes to an earlier archive or version of that diagram until the lock is released.


Merging Independent Diagrams

In ERwin, you can work independently from the other data modelers in your workgroup and then merge your diagrams together. For example, if two independent data modelers are working on separate parts of a model, the two models can be merged into a single diagram.

When ERwin merges two diagrams, it first determines if any of the objects in the source diagram duplicate an object in the target diagram. If two objects are the same, ERwin automatically creates a single object in the merged diagram. ERwin creates a single object in the merged diagram that includes all the characteristics from both objects. If two objects are different, ERwin automatically includes both objects in the merged diagram.

The merged diagram that is, the result of the merge, can be:

•	A new diagram. Using this option, you can merge two independent diagrams into a single new diagram.

•	The target diagram. Using this option, you can iteratively merge changes from one or more diagrams into a single target diagram.

ERwin uses a sophisticated set of rules to determine whether two similar objects should be merged. The merge rules allow similar objects in different diagrams to be merged even though they may contain some minor non-identical properties. For example, two entities can be merged even if different fonts are used to render the Entity Name in the source diagram and the target diagram. When this happens, ERwin displays the conflict in the ModelMart Change Control Manager - Conflict Resolution dialog and you can resolve the conflicts so ERwin can complete the merge. See Resolving Conflicts When Diagrams Are Merged  and Summary of ModelMart Model Merge Rules  for more information.

Related Topics

  How ERwin Merges Diagram Objects

  Resolving Conflicts When Diagrams Are Merged


How ERwin Merges Diagram Objects

When you merge two diagrams, ERwin compares objects in the source diagram with objects in the target diagram and determines how to merge the objects into the merged diagram. The merged diagram can be a new diagram or the target diagram.

If two objects are the same, ERwin merges them into one object in the merged diagram. For example, if the CUSTOMER entity in the source diagram and in the target diagram are identical, ERwin creates one CUSTOMER entity in the merged diagram.

If two objects are similar but not identical, ERwin merges them into one object in the merged diagram, but adds the unique objects from both into the merged result object. For example, if the CUSTOMER entity in the source diagram has three attributes, customer-number, customer-name, and customer-status, and the CUSTOMER entity in the target diagram has two attributes, customer-number and customer-name, ERwin creates one CUSTOMER entity with three attributes (that is, customer-number, customer-name, and customer-status).

Note:	When you merge two diagrams, you can generate two types of reports, ModelMart Change Control Report and ModelMart Diagram Merge Report. See Creating a ModelMart Change Control Manager Report  for more information.


Resolving Conflicts When Diagrams Are Merged

During a merge, ERwin displays the conflicting properties in the ModelMart Change Control Manager - Diagram Merge dialog, so you can decide whether the merged object should inherit properties from the source diagram or the target diagram.

For example, if two entities named MOVIES are merged, but the datatype of an attribute in the source and target diagrams does not match, ERwin displays this conflict in the ModelMart Change Control Manager - Diagram Merge dialog and you can decide which data type to use in the merged diagram.

By default, merge conflicts are resolved by using the properties in the target diagram. Also, ERwin sets display properties (such as font and color, location of objects, zoom level, and display level) in the merged diagram to the values assigned in the target diagram.

Using the features of the ModelMart Change Control Manager, you can:

•	Filter the change list.

•	Find one or more items in the change list.

•	View information about a change in a change list.

•	Change the status (accepted or canceled) of changes in the change list.

•	Generate a report on the change list information.

If you want ERwin to use a property from the source diagram, double-click on the statement in the left pane of the ModelMart Change Control Manager - Merge Diagrams dialog to change the text color from red to black. You can also use SHIFT+click or CTRL+click to select multiple changes in the change list, then use the Toggle button [image] to reverse the status of the selected changes collectively. When you click the Toggle button, black changes in your selection become red, and red changes become black.

See Summary of ModelMart Model Merge Rules  for more information about the criteria ERwin uses to compare objects in a merge.

Note:	When two objects are the same in all respects except they have different graphical properties (for example, font, color, and position), ERwin merges the objects and automatically assigns the graphical properties found in the target diagram. You can change the properties after the merge is complete.


Merging Two Diagrams

To merge two diagrams, first open the source diagram, which can be a ModelMart diagram, an archive, version, snapshot, or .ER1 file. Then choose ModelMart Merge Manager on the ModelMart menu. ERwin opens the ModelMart Merge Manager dialog and you can choose the target diagram. The target diagram must be a ModelMart diagram.

You can click the Merge Options button to open the Merge Options dialog and specify whether you want to store the result of the merge in a new diagram or in the target diagram. In the Merge Options dialog, you can also control what happens when the same object appears in both the source and target diagrams. See Choosing Merge Options  for more information.

When you click the Merge button, ERwin opens the ModelMart Change Control Manager - Diagram Merge dialog, which works exactly like the ModelMart Change Control Manager - Conflict Resolution. The left pane shows the changes in the source diagram that will be copied into the merged diagram. The right pane shows the current state of the merged diagram. See Resolving ModelMart Change Conflicts  for more information on the use of dialog controls.

After you resolve diagram merge conflicts, you can click OK in the Diagram Merge dialog. The result is dependent on the destination option you chose.

•	If you chose a new diagram as the destination for the results of the merge, ERwin opens the Save ModelMart Diagram As dialog and you can save the merged diagram as a new diagram.

•	If you chose the target diagram as the destination for the result of the merge, ERwin updates the target ModelMart diagram with the merge information.

Related Topics

  Choosing Merge Options

  To merge two independent diagrams

  Summary of ModelMart Model Merge Rules


Choosing Merge Options

When you click the Merge Options button in the ModelMart Merge Manager dialog, ERwin opens the ModelMart Merge Options dialog. You can choose a new diagram or the target diagram as the destination of the merge results and you can control what happens when the same object appears in both the source and target diagrams.

In the Result Destination group box, choose one of the following options:

•	New Diagram. To save the result of the merge in a new ModelMart diagram.

•	Target Diagram. To save the result of the merge in the target diagram.

In the On Match group box, you can specify how identical objects are merged. You can select a different merge option for entities, domains, attribute groups, and physical objects. The merge options include:

•	Merge (default). Select this option to create a single object in the merged (target) diagram (for example, CUSTOMER).

•	Do Not Merge. Select this option (for the Entity object class only) to create two objects with the same name in the target diagram (for example, CUSTOMER and CUSTOMER).

•	Rename. Select this option to include both objects in the target diagram, but let ERwin automatically rename the second object (for example, CUSTOMER and CUSTOMER/2). For the attribute group class, ERwin renames the second object by appending a slash followed by a 1 after the attribute group name. An example is: customer-name (AK1) and customer-name (AK1/1).

Note:	During a merge, if both the source and target diagrams include the same attribute group, such as an AK1 key group, ERwin treats them as identical objects, even if their group members (attributes) are different. See Assigning Key Group Membership in the Attribute Editor “ for more information.


To merge two independent diagrams

1.	Open the source diagram (for example, CUSTOMER.ER1).

2.	Click the Merge ModelMart button [image] on the ModelMart toolbar or choose ModelMart Merge Manager on the ModelMart menu.

3.	Choose the ModelMart diagram that you want to use as the target diagram (for example, videostore..movies1).

4.	Click the Merge Options button. More>>

5.	Click the Merge button. ERwin opens the ModelMart Change Control Manager - Diagram Merge dialog that shows any conflicts between the objects in the source and target diagrams.

6.	Optionally, choose one or more of the following while comparing the changes in both lists:

•	To include the source diagram changes instead, double-click on the change statement in the left pane (source) to change it from red to black text. ERwin cancels the corresponding change in the right pane (target). You can also use SHIFT+click or CTRL+click to select multiple changes in the change list. When you click the Toggle button [image], black changes in your selection become red, and red changes become black.

•	To display conflicting changes only, click the Show Conflicts button [image].

•	To display or hide detail-level changes (such as a foreign key attribute), click the Show Details button [image].

•	To display or hide graphical changes (such as the new position of an entity) click the Show Graphical Changes button [image].

•	To display detailed information about a change statement, select the item in the change list, then click the ModelMart Change Information button [image]. More>>

•	To specify search criteria that you want to use to find one or more change statements in the change list, click the Find in Script button [image]. More>>

•	To undo or redo the selected top-level change, click the Toggle button [image]. You can also use SHIFT+click or CTRL+click to undo and redo multiple changes simultaneously.

•	To generate a report on the change list information, click the Report Browser button [image]. More>>.

7.	Click the Continue button [image] when you finish resolving any conflicts between models. ERwin prompts you to automatically layout the objects in the merged diagram. Click Yes to let ERwin arrange the objects or No if you want to manually layout the diagram.

•	If you chose the target diagram as the destination for the result of the merge, ERwin prompts you to replace the existing target diagram. Click Yes to replace the ModelMart diagram. Click No to cancel the merge in ModelMart, but keep the merged diagram open as an .ER1 file.

•	If you chose a new diagram as the destination for the result of the merge, ERwin opens the Save ModelMart Diagram As dialog. Select a library and type a name for the merged diagram, then click OK. ERwin saves the merged diagram in the ModelMart.

Hint:	Before you start a merge, open the target diagram and use the options in the Default Font/Color Editor to choose a distinct color for new objects so you can easily see the objects that ERwin adds from the source diagram when the merge is complete. See Using the Default Font/Color Editor  for more information.


To choose merge options when merging diagrams

1.	Choose a destination for the merge results in the Result Destination group box.

•	Choose New Diagram to save the result of the merge in a new ModelMart diagram.

•	Choose Target Diagram to save the result of the merge in the target diagram.

2.	For each object class, choose one of the following options in the On Match list:

•	To create a single object in the target diagram, choose Merge (default).

•	To include two entities with the same name in the target diagram, choose Do Not Merge.

•	To include both objects (Entities, Attribute Group, Domains, and Physical Objects) in the target diagram, but assign a unique name to the source object, choose Rename.

3.	When you are finished, click OK. ERwin returns to the ModelMart Merge Manager dialog. More>>


Summary of ModelMart Model Merge Rules
ModelMart Model Merge Rules

When you merge two diagrams, ERwin determines if the objects in the source and target diagrams should be merged based on whether the objects share certain identical properties (called merge properties). ERwin merges the two objects into one object in the target diagram if all the required merge properties are the same, even if many of the objects other properties (called non-merge properties) differ.

The table below shows the merge and non-merge properties for each type of object that can be merged:

Merge Object	Merge Properties (Must Match)	Non-Merge Properties (May be different)
Domain (Library-level)	Parent domain Domain name	All other domain properties including datatype, definition, null option, validation rule
Physical Object (for example, Segment or Tablespace)	Physical object type Physical object name Target system	All other physical object properties (for example, PCTUSED)
Subject Area	Subject area name	All other subject area properties including member entities
Stored Display	Related subject area Stored display name	All other stored display properties including definition
Entity	Entity name	All other entity properties including attributes, definition, bitmap, font or color
Relationship (Dependent)	Parent entity Child entity Verb phrase Relationship type (for example, ID)	All other relationship properties including definition, physical name, RI option
Relationship (Subtype)	Parent entity Child entity Discriminators Relationship type (for example, complete or incomplete)	All other relationship properties including definition, physical name, RI option
Attribute	Parent entity Attribute name (rolename or basename)	All other attribute properties, including the attribute group (for example, PK, AK, IE), definition, note, font or color
Attribute (FK)	Parent entity Relationship Attribute name (rolename or basename)	All other attribute properties including definition, note, font or color
Attribute Group	Attribute group type Attribute group name	All other attribute group properties, including attributes that are in the group
Table	Entity name	All other table properties including validation rules, prescripts, and postscripts.
Column	Domain Parent attribute	All other column properties, including datatype, default value, domain, null option, validation rule
Domain (Diagram-level)	Parent domain Attribute	All other domain properties including datatype, definition, null option, validation
Index	Attribute group (for example, AK2, IE1) Index type	All other index properties including tablespace
Index Member	Parent index Column	All other member properties including sort order
Decoration (Font or Color)	Font name or Color name	N/A
Report	Report name Report type	All other report properties including format
Text Block	Text (block contents)	All other text properties including color and font
Note:	When ERwin merges two diagrams, certain types of objects are merged before others so child objects can be properly evaluated. For example, since two attributes can only be merged if they belong to the same parent entity, ERwin merges all entities before it tries to merge any attributes. ERwin merges objects in the order the objects are listed in the left column in the ModelMart Merge Rules chart. For objects that have no dependencies (such as Decoration, Report, Format, and Text Block), the merge order is unimportant.


Creating a ModelMart Change Control Manager Report

In the ModelMart Change Control Manager, you can open the Report Browser to generate reports on the ModelMart diagram changes and conflicts shown in the change list.

When you click the Report Browser button [image] in the ModelMart Change Control Manager toolbar, the Report Browser opens and displays a Script Reports folder in the tree control. The number of reports in the Script Reports folder depends on the context in which the ModelMart Change Control Manager is displayed as follows:

•	If the ModelMart Change Control Manager dialog displays a single-panel change list, such as the change list displayed when reviewing diagram changes, the Script Reports folder contains two reports:

•	Script. A report on the top-level changes shown in the change list.

•	Script with Details. A report on the top-level and detail-level changes in the change list.

•	If the ModelMart Change Control Manager dialog displays a two-panel change list, such as the change list displayed when there are change conflicts, the Script Reports folder contains the following reports:

•	File Changes. A report on the top-level changes shown in the left panel in the ModelMart Change Control Manager dialog, that is, the changes you have made to the diagram since you checked it out of ModelMart.

•	File Changes with Details. A report on the top-level and detail-level changes shown in the left panel in the ModelMart Change Control Manager dialog.

•	Server Changes. A report on the top-level changes shown in the right panel in the ModelMart Change Control Manager dialog, that is, the changes that have been saved to the master diagram in ModelMart since you checked the diagram out of ModelMart.

•	Server Changes with Details. A report on the top-level and detail-level changes shown in the right panel in the ModelMart Change Control Manager dialog including detail changes.

•	Conflicts. A report on the conflicting changes show in the change list.

Related Topics

  To create a ModelMart Change Control Manager report

  ModelMart Change Control Manager Report Content

  Sample ModelMart Change Control Manager Report

  ModelMart Change Control Manager Conflicts Report Content

  Sample ModelMart Change Control Manager Conflicts Report


To create a ModelMart Change Control Manager Report

1.	Click the Report Browser button in the ModelMart Change Control Manager toolbar.

2.	In the Report Browser tree control, open the Script Reports folder.

3.	Choose one of the following

•	Double-click on the Script, File Changes, Server Changes, or Conflicts report to get a result set with information about the top-level changes in the change list.

•	Double-click on the Script with Details, File Changes with Details, or Server Changes with Details report to get a result set with information about top-level and detail-level changes in the change list.

4.	Use the Report Browser’s extensive range of features to format, print, export, or find information in the result set. See Customizing a Result Set View  for more information.


ModelMart Change Control Manager Report Content

The content of all ModelMart Change Control Manager reports is similar. The following columns are displayed in a result set generated by all ModelMart Change Control Manager reports except for the Conflicts report:

•	Operation. The operation that characterizes the change, such as create, update, delete and so on.

•	Class. The class of the object being changed, such as BPActivity.

•	Object. The name of the object being changed, such as Run Video Store.

•	Property. The property of the object being changed, such as BPLabelConnectPoint.

•	Value. The value to which the property is being changed.

The following columns are also included in the result set, but are hidden in the default report format:

•	Class Id. The ModelMart Id of the class of the object being changed.

•	Object Id. The ModelMart Id of the object being changed.

•	Object Name. The name of the object being changed.

You can easily make these columns visible. See Specifying Column Options for a Result Set for more information.

Related Topics

  Sample ModelMart Change Control Manager Report


Sample ModelMart Change Control Manager Report

The report shown below is an example of a ModelMart Change Control Manager report.

Related Topics

  ModelMart Change Control Manager Report Content


ModelMart Change Control Manager Conflicts Report Content

The following columns are displayed in a result set generated by the Conflicts report:

•	Class. The class of the object being changed, such as BPActivity.

•	Object. The name of the object being changed, such as Run Video Store.

•	File Operation. The operation (create, update, delete) of a change item originating in your copy of the ModelMart diagram, that is, the operation of a change item that appears in the left panel of the change list.

•	Server Operation. The operation (create, update, delete) of a change item saved by another user to the master diagram in ModelMart, that is, the operation of a change item that appears in the right panel of the change list.

•	Property. The property of the object being changed, such as Name.

•	File Value. The value of a change item property originating in your copy of the ModelMart diagram, that is, the value of the change item property that appears in the left panel of the change list.

•	Server Value. The value of a change item property saved by another user to the master diagram in ModelMart, that is, the value of the change item property that appears in the right panel of the change list.

The following columns are also included in the result set, but are hidden in the default report format:

•	Class Id. The ModelMart Id of the class of the object being changed.

•	Object Id. The ModelMart Id of the object being changed.

•	Object Name. The name of the object being changed.

You can easily make these columns visible. See Specifying Column Options for a Result Set for more information.

Related Topics

  Sample ModelMart Change Control Manager Conflicts Report


Sample ModelMart Change Control Manager Conflicts Report

The report shown below is an example of a ModelMart Change Control Manager Conflicts report.

Related Topics

  Conflicts Report Content


Exiting the ModelMart Change Control Manager

You can click the Cancel button [image] on the ModelMart Change Control Manger toolbar to exit the ModelMart Change Control Manager. When you choose this option, none of the changes in the change list are saved to the master diagram in ModelMart but the ModelMart diagram, which includes any changes that you have made, remains open.


ModelMart Change Control Manager Topics

Using the ModelMart Change Control Manager

ModelMart Change Control Manager Toolbar Buttons and Menu Options

Summary of ModelMart Change List Symbols and Keywords

Working with Change Lists

Filtering a Change List

Canceling Changes in a Change List

Finding Items in a Change List

Viewing the Currently Selected Search Criteria

View Information About a Change in a Change List

Saving the Current State of a ModelMart Diagram to an ER1 File


Using ERwin as a ModelMart Client

The model development features of ERwin combined with the multiuser management features of ModelMart provide a rich environment for model development. Workgroup team members can concurrently develop large data models for today’s client/server database applications.

ModelMart technology provides a sophisticated model management system for team development projects. In a multiuser environment, ERwin diagrams are stored in a central database called the ModelMart that runs under the Microsoft SQL Server, Sybase, Oracle, or INFORMIX relational database management system. Because ModelMart offers both diagram-level locking and comprehensive conflict resolution capabilities, you can replicate a diagram from the ModelMart and edit it on your workstation without worrying about possible conflicts with the changes made by other users. When you save a model to ModelMart, ERwin shows you a list of changes that you can approve or cancel.

ERwin also compares your changes with those made by other ModelMart users. If your changes conflict, you can selectively save or cancel each change. To help you track and sort changes and conflicts, you can preview the change list, filter it to highlight list items, and create a customized report to help resolve conflicts in collaboration with other modelers and the project leader. You can print a ModelMart report locally, export it to RPTwin (the Logic Works companion reporting tool), or export it to another Windows application for additional analysis or formatting. You can also use the Report Browser, a powerful reporting tool that lets you generate highly customizable reports using information in ERwin and ModelMart diagrams.

Also in ModelMart, you can combine two separate diagrams and in doing so, unify duplicate objects, and add unique entities and attributes to the target diagram.

During the development process, ModelMart version control features let you archive the changes made to a diagram each time the diagram is saved to the ModelMart, or generate a full version of a diagram at any time. You can use a diagram archive or version to roll back all of your changes, or you can compare the contents of the archive or version with the current diagram and selectively choose the changes you want to undo.

ERwin also supports two popular application development tools, Visual Basic from Microsoft Corporation and PowerBuilder from Sybase, Inc. You can therefore manage both client-oriented information and server-oriented information and store that information in your ModelMart.

In addition, ERwin/Navigator, a read-only version of ERwin, lets your workgroup share information with others without the risk that unauthorized changes might be saved to the ModelMart.

Related Topics

  Before You Can Use ERwin with ModelMart


Before You Can Use ERwin with ModelMart

Before you can use ERwin as a ModelMart client:

•	Your ModelMart Administrator must have installed and initialized ModelMart on the DBMS.

•	The ERwin program files must be installed on each client workstation.

•	The client connectivity software for your DBMS must be installed on your client workstation so that you can connect to the DBMS on which ModelMart is installed.

Related Topics

  Connecting to ModelMart


Connecting to ModelMart

Before you can use ERwin with ModelMart, you must first connect to the database server that contains the ModelMart. When you start ERwin for the first time, ERwin opens the ModelMart Connection Manager dialog so that you can type your user login and password.

When you click Advanced, ERwin expands the ModelMart Connection Manager so you can type additional information about the server. You must specify a particular DBMS version. Select the server type (for example, SQL Server Vers. 6 - using db-lib, Oracle Vers. 7.xx, or Informix Vers. 7/9.xx) in the Host DBMS box. Then type the server name (for example, sql6, mm.world, or informix911) in the DBMS Connection box.

For Microsoft SQL Server or Sybase, you can place the ModelMart Control Tables (erw_Master and erw_License) in a different database. Type the name of this database (for example, erwinmm) in the ModelMart Master Database box.

After you type the necessary information and click OK, ERwin connects to the server and resumes or starts a ModelMart session.

Note:	The maximum number of users that can log on to the ModelMart is limited by your Logic Works license agreement. See Understanding Your ModelMart License Agreement  for more information.

The enhanced Connection Manager in ModelMart version 3.0 supports ModelMart connections on a per user basis. This means that one user can connect one or more ModelMart clients, such as ERwin, BPwin, or the ModelMart Synchronizer to the ModelMart at the same time.

Related Topics

  To Connect to ModelMart


To connect to ModelMart

1.	Click the Connect to ModelMart button [image] on the ModelMart toolbar. ERwin opens the ModelMart Connection Manager dialog.

2.	Type the necessary information to connect to the ModelMart.

•	If your DBMS is a Sybase or a Microsoft SQL Server, select the appropriate DBMS version and connection library option (for example, SQL Server Vers. 6 - using db-lib) in the Host DBMS box. Type the server name in the DBMS Connection box (for example, sql6). Then, type the name of the database that contains the ModelMart Control Tables in the ModelMart Master Database box (for example, erwinmm).

•	If your DBMS is Oracle, select the appropriate DBMS version and connection library option (for example, Oracle Vers. 7xx) in the Host DBMS box. Then, type the server name in the DBMS Connection box (for example, mm.world).

•	If your DBMS is a INFORMIX, select the appropriate DBMS version and connection library option (for example, Informix Vers. 7/9.xx) in the Host DBMS box. Type the name of the ODBC driver you use to access the ModelMart database in the DBMS Connection box (for example, informix911).

3.	Click OK. ERwin establishes connection with the selected server. You can now begin working with ModelMart.

Note:	If you want to synchronize an ERwin ModelMart diagram with tables stored in a database on a target server, you must also log on to that target server. See Connecting ERwin to a Target Server  for more information.


Disconnecting from ModelMart

You can use the ModelMart Connection manager to disconnect from a ModelMart. When you choose ModelMart Connection Manager on the ModelMart menu, ERwin opens the ModelMart Connection Manager dialog. If you have a connection to ModelMart, the Disconnect button is enabled. When you click the Disconnect button, ERwin closes your ModelMart session and disconnects from the ModelMart database server.

Related Topics

  To Disconnect from ModelMart


To disconnect from ModelMart

1.	Click the Connect to ModelMart button [image] on the ModelMart toolbar or choose ModelMart Connection Manager on the ModelMart menu. ERwin opens the ModelMart Connection Manager dialog.

2.	Click the Disconnect button. ERwin disconnects from the ModelMart database server.


The ModelMart Toolbar

The ModelMart Toolbar, located below the standard ERwin Toolbar, contains buttons that let you quickly access often used ModelMart features. As a shortcut, you can click a toolbar button instead of using standard menu options. See ModelMart Menu Options and Toolbar Buttons  for more information.

Click the Toggle ModelMart Toolbar button [image] on the ERwin Toolbar or check the ModelMart Toolbar toggle option on the Window menu to display or hide the ModelMart Toolbar.

Related Topics

  To display or hide the ModelMart Toolbar


To display or hide the ModelMart Toolbar

1.	By default, ERwin displays the ModelMart Toolbar.

•	Click [image] on the ERwin Toolbar or choose Toolbars from the View menu and clear ModelMart the ModelMart option in the submenu.

•	Click [image] on the ERwin Toolbar again or choose Toolbars from the View menu and select the ModelMart option in the submenu.

Note:	When you touch any ModelMart Toolbar button with the Selection Tool, ERwin displays ToolTip help under the button to describe its purpose.


ModelMart Menu Options and Toolbar Buttons

In ERwin, all ModelMart functions are accessible through the ModelMart menu. The following chart briefly describes the purpose of each ModelMart menu option, identifies the ModelMart Toolbar button that performs the same function (if available), and explains where to get more information.

ModelMart Menu Options and Toolbar Buttons

ModelMart  Menu Option	ModelMart Toolbar Button	Select this Option or Button to…
New ModelMart Diagram		Create a new ModelMart diagram. See Creating a New ModelMart Diagram  for more information.
Open ModelMart Diagram		Open a diagram that is stored in a ModelMart library. See Opening a ModelMart Diagram  for more information.
Close ModelMart Diagram	—	Close a ModelMart Diagram. The options on the Close ModelMart Diagram <Name> dialog let you save your diagram to the ModelMart, save your diagram as an .er1 file with or without a snapshot, or close without saving. You can also choose to keep the diagram locked after it is closed. See Closing a ModelMart Diagram for more information.
Save ModelMart Diagram		Save a ModelMart diagram. Before you save your changes, you can choose to review a change list. If you are saving the diagram for the first time, ModelMart prompts you to name the diagram and assign it to a library. See Saving a Diagram to the ModelMart for more information.
ModelMart Save As	—	Save a ModelMart diagram with a different name. See Saving a ModelMart Diagram under Another Name for more information.
Lock ModelMart Diagram		Lock or unlock the diagram in the active window. To lock a diagram, press the Lock toolbar button or select the Lock ModelMart Model option on the ModelMart menu. To unlock a diagram, press the Lock toolbar button or clear the Lock ModelMart Model option. See Summary of Locking Options for more information.
ModelMart Merge Manager		Merge the current active diagram with another ModelMart diagram. You can choose a source and target that you want to merge and then displays a list of conflicts between the source and the target diagrams. See Merging Independent Diagrams  for more information.

ModelMart Toolbar ButtonSelect this Option/Button to…
ModelMart VersionManager		Open an archive or version of a ModelMart diagram. Compare the differences between a parent diagram and an archive or version of the same diagram and optionally roll back to the earlier state of the diagram. See Comparing Different ModelMart Diagram Archives or Versions  for more information.
ModelMart Change Control Manager		Review the changes that you applied to the current ModelMart diagram since you opened or last saved it and decide if you want to keep or cancel the changes. See Reviewing ModelMart Changes for more information.
ModelMart Refresh Manager		Import the changes that other users saved to the master version of the diagram into your active copy of the ModelMart diagram. See Refreshing a ModelMart Diagram for more information.
ModelMart Library Manager		Create, rename, or delete a library; or rename or delete a diagram. See Managing ModelMart Libraries and Diagrams  for more information.
ModelMart Subject Area Manager		Create, update, and delete ModelMart subject areas (submodels). See How ModelMart Supports Submodeling  for more information.
ModelMart Connection Manager		Connect to a different server or log on as a different user. ERwin prompts you to close any open diagrams in the current session. See Connecting to ModelMart  for more information.
ModelMart Session Manager	—	Terminate a user’s modeling session. See Managing ModelMart Sessions  for more information.
ModelMart Security Manager		Add and remove ModelMart users, create and/or edit security profiles, and assign a user to a security profile. See Creating ModelMart Users  and Using ModelMart Security Profiles  for more information.
ModelMart Synchronizer		Opens the ModelMart Synchronizer so that you can synchronize an ERwin data model with a BPwin business process model or vice versa in ModelMart.
Note:	Your security profile determines whether or not a menu option or toolbar button is unavailable (dimmed). If you need to access a function that is unavailable, ask your ModelMart Administrator to change your security permissions.


ModelMart Dialog Icons

ModelMart uses the icons shown in the following table to identify the major objects that can be created and modified in the ModelMart modeling environment. In ModelMart dialogs, each object is identified by an icon and a name. The icon identifies the object type. The name is a unique identifier for the object.

Icon	Object Type	Used To
	ModelMart	Store ModelMart data model diagrams in one or more ModelMart libraries.
	ModelMart Library	Store a collection of ModelMart diagrams and the set of objects (such as domains, validation rules, and trigger templates) shared by those ModelMart diagrams.
	ModelMart Diagram	Represents an ERwin diagram stored in the ModelMart. There are three read-only backup types of a ModelMart diagram (Archive, Version, and Snapshot).
	ModelMart Template	Represents a template stored in the ModelMart. A new ModelMart diagram based on a template inherits all the settings and ERwin objects in the template.
	ModelMart Subject Area (Submodel)	Represents a subject area in a ModelMart diagram. You can open a ModelMart subject area independently of the diagram that contains the subject area.
	Archive	Represents the changes between one diagram save operation and the next, also called a delta-archive. If the Auto Archive feature for a library is enabled, ERwin generates an archive each time a diagram is saved to that library. You can use an archive to revert back to an earlier state of a ModelMart diagram. The name assigned to an archive has the following format: <diagram name>:<user name> on <date>;<number>
	Version	Represents a historic read-only version of a ModelMart diagram so that you can revert back to an earlier version of a ModelMart diagram. The name assigned to a version has the following format: Vn : <diagram name>
	Snapshot	Represents a backup read-only version so that you can work on a diagram offline and merge your changes back into the master diagram in the ModelMart at a later time. The name assigned to a snapshot has the following format: [<user name> on <date>]
ModelMart Dialog Icons


ModelMart Security Features

ModelMart implements a level of security above your native database security features to ensure that a ModelMart object, such as a library, diagram, subject area, domain, physical object, entity, or attribute, can only be created, changed, or deleted by appropriate personnel. The ModelMart administrator assigns user permissions that determine which objects you can change and save to the ModelMart. For example, if you do not have permission to update a diagram, you can open that diagram as read-only but you cannot save your changes back to the ModelMart.

The ModelMart permissions assigned to you also determine which options on the ModelMart Toolbar and ModelMart menu are available during your modeling session. ModelMart options, such as the ModelMart Security Manager, that are not available to you are unavailable (dimmed) on the menu and toolbar.

ERwin does not restrict the actions that are available to you in the ERwin modeling environment based on your ModelMart permissions. You can create, update, or delete all data model and library objects in any model. You can also save your changes to a standard .er1 (ERwin single-user) file. However, if you try to save an updated diagram back to the ModelMart, ModelMart prohibits any action for which you do not have permission, such as, deleting an entity.

You can see if any of your changes have been prohibited when you open the ModelMart Change Manager dialog. ModelMart marks prohibited changes with the prohibited symbol ( [image]). When you save, ModelMart updates the master version of the diagram in the ModelMart with the changes for which you had permission, but discards all prohibited changes.

When working with ModelMart diagrams that have subject areas (submodels), special security rules apply. See Submodeling and Security for more information.

See Creating ModelMart Users  and Using ModelMart Security Profiles  for information.

Note:	Although ModelMart checks user permissions when you access the ModelMart Menu or Toolbar or save a diagram to the ModelMart, it does not check user permissions for ERwin menu or toolbar options. Because of this, you can update ERwin library objects, (such as domains, validation rules, and trigger templates) at anytime during amodeling session. However, you cannot save to ModelMart any library object changes that are prohibited by your user permissions.


Starting the ModelMart Synchronizer

You can use the ModelMart Synchronizer button [image] on the ModelMart toolbar to start the ModelMart Synchronizer, an independent application that you can use to synchronize an ERwin data model with a BPwin business process model or vice versa in ModelMart. See the ModelMart Synchronizer Online Help for more information.


How ERwin and ModelMart Support Team Modeling

You can use ERwin as a standalone application to create and maintain a data model on a single workstation. In addition, every version of ERwin greater than version 2.6 incorporates sophisticated client/server features so that you can use ERwin as a client to a ModelMart on a server workstation. Any number of users can work simultaneously on the same data model stored in the ModelMart.

In the ModelMart environment, a master copy of the data model is maintained on your SQL database server. When you open a diagram stored on the server, ModelMart automatically creates a copy of the master data model and sends it to your workstation. At the same time, ModelMart creates a snapshot of the diagram that records the status of the master model when it downloads your copy. Later, when you finish modeling and attempt to save your changes back to the server, ModelMart uses this snapshot to generate a transaction list, which shows the changes that were made to the ModelMart master version since you began working on your copy. Using this list, you can intelligently merge your work back into the ModelMart master version and accept or override the changes made by other users.

When used with ModelMart, ERwin provides several lock options to ensure that only one set of changes can be saved at a time. When you open a ModelMart diagram, you can lock it so that other users cannot save changes until you unlock it. If you choose to work on a diagram without locking it, you and other users can save changes on a first-come-first-serve basis.

The ModelMart can contain one or more libraries. A ModelMart library contains one or more ModelMart diagrams that share a common set of object definitions, such as domains, validation rules, or physical storage properties. Because any change to a library object immediately impacts all diagrams in the library, library objects are typically created and updated by the lead modeler or database designer. For more information, click on an item in the list below:

•	Use a ModelMart Library

•	Create a New ModelMart Diagram

•	Use ModelMart Diagram Locking Options

•	Open an Existing ModelMart Diagram

•	Save a Diagram in the ModelMart Environment

•	Close a Diagram


Understanding ModelMart Libraries

When using ERwin as a single-user application, the attributes in one diagram can inherit multiple properties from a domain, but attributes in different diagrams cannot share the same domain definition. Similarly, ERwin objects in different diagrams cannot share validation rules, triggers, or stored procedures.

To make object definitions available to multiple diagrams, ModelMart uses a container object called a ModelMart library. ERwin stores a group of diagrams that share a set of common objects in a ModelMart library. The objects which can be shared by all the diagrams in a library include: Domains, Edit Styles, Display Formats, Validation Rules, Physical Storage Objects, Stored Procedure Templates, Prescript and Postscript Templates, and Trigger Templates.

You can modify a library object using the appropriate ERwin editor. For example, you can change properties of a column in the Column Property Editor. Before you save any changes back to the ModelMart master version, you can review and cancel any or all of your modifications. If you make changes to library objects, ERwin displays these changes for review before it displays other non-library object changes. When you save, ERwin automatically applies library object changes to every diagram stored in that library. See Reviewing Changes When Saving a Diagram to the ModelMart  for more information.

Note:	Use caution when you save a change that involves a library object. ERwin automatically applies these changes to all diagrams in the same library, which may seriously affect the work of other users.

The ModelMart administrator can create, rename, and delete ModelMart libraries using the ModelMart Library Manager. See Managing ModelMart Libraries and Diagrams  for more information.


Creating a New ModelMart Diagram

Before you create a new diagram in ModelMart, you must select the library in which you want to save it. When you choose the New ModelMart Diagram option on the ModelMart menu, ERwin opens the Select ModelMart Library dialog that lists all the libraries in the ModelMart.

When you select a library from the ModelMart Library list, the values assigned to the objects in the library are displayed in the ModelMart Library Object Set list. After you select a library, click the OK button. ERwin automatically assigns the library objects to the new diagram and opens a new Diagram window.

You are now ready to add entities and attributes, define relationships, and develop your ModelMart data model diagram.

Note:	If you click the Cancel button in the Select ModelMart Library dialog, your new diagram inherits library object definitions from the default domain.

You can create a new library in ModelMart to hold your diagram using the ModelMart Library Manager. See Managing ModelMart Libraries and Diagrams  for more information.

Related Topics

  To create a new ModelMart diagram


To create a new ModelMart diagram

1.	Click the New ModelMart Diagram button [image] on the ModelMart toolbar or choose New ModelMart Diagram on the File menu. ERwin opens the Select ModelMart Library dialog.

2.	Choose the library in which you want to save the diagram in the ModelMart Library list. ERwin displays the library objects in the selected library in the ModelMart Library Object Set list.

3.	Click OK. ERwin opens a new diagram window and automatically assigns the library objects from the library you selected to the new diagram.

Note:	If you do not select a library when you open a new ModelMart diagram, you must select one in the Save ModelMart Diagram As dialog in order to save the diagram to the ModelMart. See Saving a ModelMart Diagram under Another Name  for more information.


Using ModelMart Diagram Locking Options

ERwin supports automatic diagram locking to prevent one user from inadvertently overwriting the changes previously saved to the ModelMart by another user. When you open a diagram, ERwin provides three locking options to help you manage how changes are saved to the ModelMart:

•	Locked. If you have permission to update and save a diagram, you can lock a diagram exclusively for your own use and prevent other users from saving changes to the master copy in the ModelMart during your modeling session. Because you hold an exclusive lock, you can save to the ModelMart master version without having to check for conflicting changes made by other users. In addition, you can select the Keep ModelMart Diagram Lock option on the Close ModelMart Diagram dialog to keep a diagram locked for your own use even after you have closed ERwin. For example, if you save an .er1 file to work offline, you can keep the ModelMart master version locked so that no other user can make changes to it while you are working offline.

•	Unlocked (default). If you have permission to update and save a diagram, you can open a diagram in Unlocked (shared) mode. Because other users can save changes to the ModelMart while you are working on an unlocked diagram, you may have to resolve conflicts with their changes when you save your work to the ModelMart. When you open a diagram in Unlocked mode, ERwin automatically creates an in-memory copy, called a snapshot, of the most recent diagram version. Because ERwin uses the snapshot to track changes that were made since you opened the diagram, you can merge your changes into the master version without inadvertently overwriting changes made by other users.

•	Read-only. ERwin automatically assigns this lock mode if you do not have permission to update and save the selected diagram. When you open a ModelMart diagram in read-only mode, you can view the diagram and save it as an .er1 file, but you cannot save the diagram back to the ModelMart.

Before you open a diagram, ModelMart checks your assigned permissions and determines whether or not another user has locked the diagram you want to open. ERwin uses this information to determine which locking options are available for your modeling session.

Although Unlocked is the default setting for opening a diagram, you may not be able to choose this option when you open the Open ModelMart Diagram dialog and choose a diagram. ERwin dims the locking options if you do not have permission for an action or if another user has locked the selected diagram. For example, if you do not have permission to update a diagram, both the Locked and Unlocked options are unavailable (dimmed) and you have read-only access. Alternatively, if someone has previously locked the diagram that you want to open, ModelMart dims the Locked option and you can open the diagram in Unlocked mode.

Note:	Whether or not you can update and save a diagram is defined in your security profile. Contact your ModelMart Administrator if you need to update a diagram that opens as read-only.

During a modeling session, you can lock a diagram that you opened in unlocked mode (and vice versa) by clicking the Lock/Unlock ModelMart Diagram toolbar button, or by choosing the Lock ModelMart Diagram toggle option on the ModelMart menu. See ModelMart Menu Options and Toolbar Buttons  for more information.

Related Topics

  Summary of Locking Options


Summary of Locking Options

The following chart explains how lock options affect concurrent access to a ModelMart diagram.

When you open a Diagram in...	You can...	Other users can...
Locked Mode	Update and save your changes to the ModelMart as often as you want, without conflict resolution	Read and update, but they cannot save the diagram until your lock is released
Unlocked Mode	Update and save on a first-come-first-serve basis, as long as no other user has locked the diagram	Read, update, save, and lock the diagram
Read-Only Mode	Read and save as an .er1 file only	Read, update, save, and lock the diagram
Summary of ModelMart Lock Options

The diagram lock option that you select determines the options available to you when you save a diagram back to the ModelMart. For example, if you open a diagram in read-only mode, ERwin dims the Save to ModelMart option on the ModelMart menu.


Opening a ModelMart Diagram

A ModelMart diagram receives its object definitions from its parent library when it is opened, and for this reason it cannot be opened directly from the ERwin File menu. To open an existing ModelMart diagram, select the Open ModelMart Diagram option on the ModelMart menu. ERwin opens the Open ModelMart Diagram dialog.

Because ModelMart diagrams are stored in a library, you must first select the library that contains your diagram from the ModelMart Library list in the right pane. ERwin displays all the diagrams in the selected library in the ModelMart Diagram list in the left pane.

Click on a diagram name to select it. ERwin displays information about the selected diagram, such as when it was created and last updated, in the information area at the bottom of the dialog.

When you open a diagram, choose one of the following lock options:

•	Unlocked (default). Click this button to update and save a diagram in Unlocked (shared) mode. Because other users can also save changes while you are working on the diagram, you may have to resolve change conflicts.

•	Locked. Click this button to lock a diagram exclusively for your own use and prevent other users from saving changes to the diagram during your modeling session.

•	Read-only. Click this button to view a diagram. You can make changes to the diagram, but you cannot save them directly to the ModelMart.

See Using ModelMart Diagram Locking Options  for more information.

After you select the library, diagram, and lock option, click OK. ERwin opens the diagram in the Diagram window.

Note:	If you want to open an ERwin .er1 diagram, choose the Open option on the File menu. ERwin opens the ERwin Open File dialog. See Opening an ERwin Diagram  for more information.

Related Topics

  To open a ModelMart diagram


To open a ModelMart diagram

1.	Click the Open ModelMart Diagram button [image] on the ModelMart toolbar or choose Open ModelMart Diagram on the ModelMart menu.

2.	Select the library that includes the diagram that you want to open in the ModelMart Library list. ERwin opens the diagrams associated with the selected library in the ModelMart Diagram list on the left.

3.	Select the diagram that you want to open in the ModelMart Diagram list. ERwin displays information about the selected diagram in the information area at the bottom of the dialog. This information includes when the diagram was created, last saved, and the name of the user who has it locked, if applicable.

4.	Accept the default lock option (Unlocked) or click on the appropriate button (Locked or Read-only) in the Lock Options group box.

5.	Click OK.

Note:	To open an archive or version of a ModelMart diagram, you must use the ModelMart Version Manager. See To open an archive of a ModelMart diagram  or To open a version of a ModelMart diagram  for more information.


ModelMart Diagram Templates

A template stores diagram settings and ERwin objects (for example, background color, foreign-key color, shadow offset, display level, predefined stored displays, and so on) that are automatically applied to each diagram based on the template. Templates provide the ideal way of maintaining a consistent look and feel across models. Templates automatically assign diagram settings and ERwin objects to new diagrams.

You can save an existing ModelMart diagram as a template simply by selecting the Save Diagram as a Template check box in the Save ModelMart Diagram As dialog. See Saving a ModelMart Diagram as a Template  for more information. All of the settings and objects in the ModelMart diagram become part of the template. In ModelMart dialogs, a template is identified by the [image] symbol. You can open and edit a template in the same way that you open and edit any other ModelMart diagram.

Once you have defined an existing ModelMart diagram as a template, you can use this template as the basis for creating new ModelMart diagrams. When you choose New from the File menu, ERwin opens the ERwin Template Selection dialog that shows the available ERwin templates. If you have a connection to ModelMart, the ModelMart button is enabled. When you click the ModelMart button, ERwin opens the Open ModelMart Diagram dialog. In this dialog, if you select a library, ERwin displays a list of the templates in the library. If you double-click on a template, ERwin opens a new ModelMart diagram based on the selected template.

An alternative way to create a ModelMart diagram based on a template is to choose Open ModelMart Diagram from the ModelMart menu, select a library, and double click on a template to open it. Then, choose ModelMart Save As from the ModelMart menu to create a new diagram. The new diagram includes all the settings and ERwin objects in the ModelMart template.

Note:	ModelMart does not give you the option to select a template when you choose New ModelMart diagram from the ModelMart menu.

Related Topics

  To create a new ModelMart diagram based on a template


To create a new ModelMart diagram based on a template

1.	Choose New on the ERwin File menu. ERwin opens the ERwin Template Selection dialog.

2.	Click the ModelMart button. ERwin opens the Open ModelMart Diagram dialog.

3.	Select the library from the ModelMart Library list that contains the template you want to base your new ModelMart diagram on.

4.	Select the template [image] that you want to use in the ModelMart Diagram list. ERwin displays information about the selected diagram, such as when the template was created, and last saved, in the information area at the bottom of the dialog.

5.	Click OK. ERwin opens a new diagram based on the template you selected.

Note:	The ModelMart button in the ERwin Template Selection dialog is only enabled when ERwin has a connection to ModelMart.


Saving ERwin Diagrams in the ModelMart Environment

ERwin provides three options for saving a diagram (Save to ModelMart, ModelMart Save As, and Save As .er1 File) and three options for creating a special backup version (Archive, Version, and Snapshot) of your diagram. Each of the save options is briefly introduced below and explained in detail in the following sections.

•	Save to ModelMart. Choose Save to ModelMart on the ModelMart menu to save changes you have made in a workstation copy back to the master copy in the ModelMart. Before you commit your changes to the ModelMart, ERwin opens the Change Control Manager dialog so that you can review and confirm your changes, and resolve any conflicts between the changes you have made in your copy and changes made by other users that have already been saved to the ModelMart. See Saving a Diagram to the ModelMart  and Reviewing Changes When Saving a Diagram to the ModelMart  for more information.

If you want to be able to revert back to an earlier ModelMart version after saving your changes to the ModelMart, either maintain archives of the diagram, or periodically create versions of your diagram. See Maintaining Archives and Versions of ModelMart Diagrams  for more information.

To revert back to a diagram archive or version, use the ModelMart Version Manager to open the archive or version you want to restore, then choose ModelMart Save As on the ModelMart Menu and select the ModelMart diagram you want to overwrite. See Reverting to an Archive or Version of a ModelMart Diagram  for more information.

•	ModelMart Save As. Choose ModelMart Save As on the ModelMart menu to save a diagram in the ModelMart under a new name. Using this option, you can create a new ModelMart diagram from a previously saved ModelMart, archive, version, or .er1 diagram. See Saving a ModelMart Diagram under Another Name  for more information.

You can also save a ModelMart diagram as a template. A new ModelMart diagram that is based on this template will automatically inherit all the settings and ERwin objects stored in the template. See Saving a ModelMart Diagram as a Template  for more information.

•	Save as .ER1 File. Choose Save as .er1 File on the ModelMart menu to save a ModelMart diagram in ERwin’s .er1 file format. This option appears on the Close ModelMart Diagram dialog that is opened when you choose the Close option on the ModelMart menu. By saving a ModelMart diagram as an .er1 file, you can work on a data model offline and work at a remote site without maintaining a live connection to the ModelMart. Also, if another user has a locked copy of the same diagram, you can use this option to preserve your changes until the lock is released.

If you want to merge an .er1 file back to a diagram saved in the ModelMart at a later time, be sure you check the Keep ModelMart Snapshot for Later Merge check box in the Close ModelMart Diagram dialog. When you check this box, ERwin creates a snapshot of the original ModelMart diagram from which the .er1 file is created. This snapshot is used as the baseline for detecting database changes and helps you merge your work back to the ModelMart. When you choose Save to ModelMart to merge your changes back to the ModelMart, ERwin compares the current ModelMart diagram to the snapshot so it can detect changes made by other users that occurred while you were working offline. See Saving a ModelMart Diagram as an .ER1 File  for more information.

Note:	To be able to update an .er1 file and subsequently merge your changes back to the ModelMart, use a version of ERwin that is compatible with your ModelMart installation.

Related Topics

  Saving a Diagram to the ModelMart

  Reviewing Changes When Saving a Diagram to the ModelMart

  Maintaining Archives and Versions of ModelMart Diagrams

  Reverting to an Archive or Version of a ModelMart Diagram

  Saving a ModelMart Diagram Under Another Name

  Saving a ModelMart Diagram as a Template

  Saving a ModelMart Diagram as an .ER1 File


Saving a Diagram to the ModelMart

To save changes you have made in a workstation copy of a diagram back to the master copy stored in the ModelMart, choose Save to ModelMart on the ModelMart menu. ERwin opens the Save Diagram to ModelMart dialog.

The Archive Original Version box in the Save Diagram to ModelMart dialog indicates if the library into which you are saving your diagram has the auto archiving feature enabled. If this box is selected, the auto archiving feature is enabled, and an archive of the diagram is automatically created each time you save the diagram to the ModelMart. See Maintaining Archives and Versions of ModelMart Diagrams  for more information.

Select the Review All Changes Before Save check box if you want to review the changes you have made in the current session before committing them to the ModelMart.

When you are ready, click OK to commit your changes to the ModelMart or click Cancel to return to the ERwin diagram window without saving your changes. When you click OK in the Save Diagram to ModelMart dialog, ERwin either saves your changes to the ModelMart immediately or it opens another dialog as explained below:

•	If you opened the diagram from ModelMart and you did not check the Review All Changes Before Save box in the Save Diagram to ModelMart dialog, and none of your changes conflict with a change made by another user, ERwin automatically updates the ModelMart master copy with your changes without opening any other dialogs.

•	If you checked the Review All Changes Before Save check box, ERwin opens the Change Control Manager - Review Changes dialog so that you can review your changes before you commit them to the ModelMart. See Reviewing Changes When Saving a Diagram to the ModelMart  for more information.

•	If you created the diagram on your workstation and you have not previously saved it to the ModelMart, when you choose Save to ModelMart or ModelMart Save As on the ModelMart menu, ERwin opens the Save ModelMart Diagram As dialog so that you can name the diagram and choose the ModelMart library in which you want to save it.

To save the diagram to the ModelMart, first select the library in which you want to save the diagram by clicking on the library name in the ModelMart Library list, then type the name you want to assign to the new diagram in the ModelMart Diagram box. ERwin automatically inserts the library name and two periods immediately in front of the diagram name you assign. For example, if you save the movies diagram in the videostore library, ERwin names the diagram videostore..movies.

If you have permission and you want to create a new library in which to save the diagram, click the ModelMart Library button to open the ModelMart Library Manager. See Managing ModelMart Libraries and Diagrams  for more information.

Click OK to save the diagram to the ModelMart or click Cancel to close the dialog and return to the ModelMart diagram window without saving the diagram.

Note:	If another user has locked the diagram, ERwin informs you that you cannot save it while it is locked by another user. See Saving a ModelMart Diagram as an .ER1 File  for more information.

If any of your changes conflict with a change made by another user, ERwin opens the Change Control Manager - Conflict Resolution dialog and you can manually accept or override the other users’ changes. See Resolving ModelMart Change Conflicts  for more information.

Related Topics

  To save a new diagram to the ModelMart

  To save changes to a ModelMart diagram


To save a new diagram to the ModelMart

1.	Click the Save the ModelMart diagram button [image] on the ModelMart toolbar or choose Save to ModelMart or ModelMart Save As on the ModelMart menu. ERwin opens the Save ModelMart Diagram As dialog.

2.	Select the library in which you want to store the new diagram in the ModelMart Library box.

3.	Type the name of the diagram you are saving in the ModelMart Diagram box.

4.	Click OK. ERwin saves the diagram in the specified ModelMart library.

Note:	If you save a new diagram into an existing library and you changed a shared library object (for example, domain, validation rule, trigger template), ERwin opens the Change Control Manager - Review Changes dialog before Step 4 so you can review the library-level changes. See Reviewing ModelMart Changes  for more information.


To save changes to a ModelMart diagram

1.	Click the Save to ModelMart button [image] on the ModelMart toolbar or choose Save to ModelMart on the ModelMart menu. ERwin opens the Save Diagram to ModelMart dialog.

2.	Select the Review All Changes Before Save check box to review your changes before you commit them to the ModelMart.

3.	Click OK. If you selected the Review All Changes Before Save check box in Step 2, ERwin opens the Change Control Manager - Review Changes dialog and, if the Archive Original Version box is selected, ERwin automatically creates a version of the diagram. Otherwise, ERwin immediately saves your changes.

Note:	If there are conflicts between your changes and the master copy of the diagram in ModelMart, ERwin opens the Change Control Manager - Conflict Resolution dialog, so that you can review your changes and resolve conflicts caused by changes made by other users before saving your work to the ModelMart. See Reviewing ModelMart Changes  and Resolving ModelMart Change Conflicts  for more information.


Saving a ModelMart Diagram under Another Name

To save time, instead of creating a new diagram in a new, blank window, you can open an existing ModelMart diagram (or an .er1 diagram file), make changes to it, and then save it to the ModelMart under a new name. To save a diagram to the ModelMart under a new name, open the diagram and choose ModelMart Save As on the ModelMart menu. ERwin opens the Save ModelMart Diagram As dialog. You can name the diagram and choose the ModelMart library you want to save it to.

To save an existing diagram under a new name, first select the library in which you want to save the diagram by clicking on the library name in the ModelMart Library list. Then type the new name you want to assign to the diagram in the ModelMart Diagram box. ERwin automatically inserts the library name and two periods immediately in front of the diagram name you assign. For example, if you change the name of a diagram from movies to videos and save it in the videostore library, ERwin names the diagram videostore..videos.

If you have permission to create a library and you want to create a new library in which to save the diagram, click the ModelMart Library button to open the ModelMart Library Manager. See Managing ModelMart Libraries and Diagrams  for more information.

Click OK to save the diagram to the ModelMart under the newly assigned name or click Cancel to close the dialog and return to the ModelMart diagram window without saving the diagram.

Note:	When you save a diagram under a new name, you can save it in the same library or a different library.

Related Topics

  To save a ModelMart diagram under another name


To save a ModelMart diagram under another name

1.	Click the Open ModelMart diagram button [image] on the ModelMart toolbar or choose Open ModelMart Diagram on the ModelMart menu.

2.	Select the library that contains the diagram that you want to save under another name.

3.	Double-click on the diagram name to open the ModelMart diagram.

4.	Choose ModelMart Save As on the ModelMart menu.

5.	Select the library from the ModelMart Library list that you want to store the renamed diagram to.

6.	Type a new name for the diagram, or select an existing diagram that you want to replace with the diagram you are saving, in the ModelMart Diagram box.

7.	Click OK. ERwin saves the diagram in the specified ModelMart library using the new name you assigned.

Note:	Use the ModelMart Save As option to rename a ModelMart diagram, archive, or version. To rename an .er1 file, use the Save As option on the File menu, not the ModelMart menu. See Saving an ERwin Diagram for more information.


Saving a ModelMart Diagram as a Template

Using a template, you can store diagram settings and ERwin objects and apply the settings when you create a new diagram. See ModelMart Diagram Templates  for more information.

You can create a template from any ModelMart diagram and save it in the ModelMart. When you choose ModelMart Save As from the ModelMart menu, ERwin opens the Save ModelMart Diagram As dialog where you can choose a library and save the active diagram as a template in the selected library. In ModelMart dialogs, templates are identified by the [image] symbol.

Related Topics

  To save a ModelMart diagram as a template


To save a ModelMart diagram as a template

1.	Open the ModelMart diagram that you want to save as a template.

2.	Click the Save ModelMart diagram button [image] on the ModelMart toolbar.

3.	Select the library in the ModelMart Library list you want to save the template to.

4.	Optionally, edit the name in the ModelMart Diagram box.

5.	Select the Save Diagram as a Template check box.

6.	Click OK. ERwin creates a template [image] from the active ModelMart diagram.

Note:	ERwin saves all information contained in the diagram as part of the template. If you do not want to include all of the information from a particular diagram in the template, open a new diagram, make any formatting and display changes, then save the new diagram as a template.


Saving a ModelMart Diagram as an .ER1 File

In ERwin, you can save a ModelMart diagram as a standard ERwin .er1 file. By saving a diagram in .er1 format you can:

•	Take a diagram offline and work on it anywhere without being connected to the ModelMart.

•	Temporarily save your work on a local or network drive when the ModelMart master copy is locked by another user.

To save a ModelMart diagram as an .er1 file, open the diagram from ModelMart and then choose Close ModelMart <Name> Diagram on the ModelMart menu. ERwin opens the Close ModelMart Diagram <Name> dialog.

Select the Save as .ER1 File check box, then click OK to save the ModelMart diagram as an .er1 file. If you want to merge your work back to the ModelMart at a later time, you must also select the Keep ModelMart Snapshot for Later Merge check box. The ModelMart snapshot reflects the status of the ModelMart master version at the time you opened the diagram. When you choose to save a snapshot, ERwin opens the ModelMart Snapshot dialog and assigns a default name, which is your user name followed by today’s date (for example, LBAKER on Oct 23 1997).

ERwin uses this snapshot when you are ready to save the diagram back to the ModelMart to determine both your changes and the changes that were saved to the ModelMart while you were working offline.

When you click OK, ERwin closes the ModelMart Snapshot dialog and opens the standard ERwin Save As dialog so that you can specify the directory and file name for the new .er1 file.

Related Topics

  To save a ModelMart diagram as an .ER1 file


To save a ModelMart diagram as an .ER1 file

1.	Click the Open ModelMart diagram button [image] on the ModelMart toolbar or choose Open ModelMart Diagram on the ModelMart menu.

2.	Select the appropriate library and then double-click on the diagram name to open the ModelMart diagram you want to save as an .er1 file.

3.	Choose Close ModelMart Diagram on the ModelMart menu.

4.	Choose Save As .ER1 File to save the ModelMart diagram as an ERwin .er1 file.

5.	If you want to merge your changes back to the ModelMart at a later time, select the Keep ModelMart Snapshot for Later Merge check box.

6.	Click OK. ERwin opens the appropriate dialogs.

•	If you checked the Keep ModelMart snapshot for later merge box, ERwin opens the ModelMart Snapshot dialog and assigns a default name to the snapshot (for example, [LBAKER on Oct 23 1997]). You can accept the default name or type a new name in the text box and then click OK. ERwin opens the ERwin Save As dialog.

•	If you did not check the Keep ModelMart snapshot for later merge box, ERwin immediately opens the ERwin Save As dialog.

7.	Type the directory and file name for the .er1 file in the Save As dialog.

8.	Click OK to save the .er1 file and return to the diagram window, which displays the .er1 version of the diagram.

Note:	When you save a ModelMart diagram as an .er1 file, the ModelMart master version remains unaltered. If you keep a snapshot, changes in the .er1 file can be selectively merged back to the ModelMart master version. See Resolving ModelMart Change Conflicts  for more information.


Working with a ModelMart Diagram Offline

You can work with a ModelMart diagram without direct and continuous access to the ModelMart. To do this, open the ModelMart diagram you want to work on offline, then choose Close ModelMart diagram on the ModelMart menu to access the save options.

In the Close ModelMart Diagram <Name> dialog, you must select the following options:

•	Save as .ER1 File. Click this button to create an .er1 file of the ModelMart diagram you want. This is the file you can take offline and modify without a connection to ModelMart.

•	Keep ModelMart snapshot for later merge. Check this option to create a snapshot of the current state of the ModelMart diagram. This is the file that ERwin uses when you merge your .er1 file changes back into the ModelMart. ERwin uses the snapshot file to detect not only the changes that you have made but also the changes that other modelers have made since the snapshot was taken.

When you click OK, ERwin first opens the ModelMart Snapshot dialog so you can name the snapshot and then opens the ERwin Save As dialog, and you can save the .er1 file. See Saving a ModelMart Diagram as an .ER1 File  for more information.

You can now work on your .er1 diagram offline.

Once you complete your changes, you typically want to merge them back to the parent diagram in the ModelMart. When you open your .er1 diagram and choose Save to ModelMart on the ModelMart menu, ERwin detects that a snapshot corresponding to your .er1 file exists and opens the Save to ModelMart Using Snapshot dialog. You can use the snapshot that ERwin automatically saved when you saved the .ER1 file or you can choose a different snapshot. This feature is useful if the original snapshot was inadvertently deleted.

When the Snapshot box contains the snapshot you want to use, choose one of the following options:

•	Yes. ERwin compares the snapshot with:

•	Your .er1 file, that is, any changes you have made to the diagram since the snapshot.

•	The parent diagram in the ModelMart, including any changes that other modelers have made since you saved the snapshot.

If ERwin detects differences between your .er1 file and the snapshot, it opens the ModelMart Change Control Manager (Review Changes) dialog and you can accept or reject the changes before committing them to the ModelMart.

If ERwin detects differences between your .er1 file and the parent diagram, and differences between the snapshot and the parent diagram in the ModelMart, it opens the ModelMart Change Control Manager (Conflict Resolution) dialog and you can resolve any conflicts before committing changes to the ModelMart. See Using the ModelMart Change Control Manager  for more information.

•	No. ERwin opens the Save ModelMart Diagram As dialog, and you can save your .er1 file to the ModelMart under a different name. See Saving a ModelMart Diagram under Another Name  for more information.

•	Cancel. ERwin cancels the merge operation and returns to your .er1 file.

Note:	By default, the Save to ModelMart Using Snapshot dialog displays the snapshot you saved when you created the .er1 file. If for some reason this snapshot has been deleted, you can choose the diagram archive or version most closely related to the deleted snapshot to merge your changes back to the master diagram in ModelMart.

Related Topics

  To create an .ER1 file for working offline

  To merge your offline .ER1 changes back to ModelMart


To create an .ER1 file for working offline

1.	Click the Open ModelMart diagram button [image] on the ModelMart toolbar or choose Open ModelMart Diagram on the ModelMart menu.

2.	Click on the library that contains the diagram you want.

3.	Double-click on the diagram. ERwin opens the diagram in a separate diagram window.

4.	Choose Close ModelMart Diagram on the ModelMart menu.

5.	Click the Save as .ER1 File button and select the Keep ModelMart snapshot for later merge check box.

6.	Click OK. ERwin opens the ModelMart Snapshot dialog which displays the default snapshot name. Accept or edit the snapshot name.

7.	Click OK. ERwin opens the Save As dialog.

8.	Choose a directory, type a name with the file extension .er1 in the File Name box, and click OK. ERwin saves the .er1 file. You can now work on this .er1 file without a connection to the ModelMart.

Related Topics

  To merge your offline .ER1 changes back to ModelMart


To merge your offline .ER1 changes back to ModelMart

1.	Choose Open on the File menu.

2.	Select the directory that contains the .er1 file you want, then click on the .er1 file. ERwin opens the .er1 file in a new diagram window.

3.	Click the Save diagram changes in ModelMart button [image] on the ModelMart toolbar or choose Save To ModelMart on the ModelMart menu. ERwin opens the Save to ModelMart Using Snapshot dialog.

4.	Accept the default snapshot or select another snapshot in the Snapshot box.

5.	Click Yes. ERwin opens one of two dialogs as follows:

•	If ERwin detects differences between your .er1 file and the snapshot, it opens the ModelMart Change Control Manager (Review Changes) dialog.

•	If ERwin detects differences between your .er1 file and the snapshot, and differences between the snapshot and the master diagram in the ModelMart, it opens the ModelMart Change Control Manager (Conflict Resolution) dialog.

6.	Click the Continue button [image] when you have reviewed the changes or resolved the conflicts. ERwin commits the changes to the parent diagram in the ModelMart.

Related Topics

  To create an .ER1 file for working offline


Closing a ModelMart Diagram

When you choose Close ModelMart Diagram on the ModelMart menu, the Close ModelMart Diagram dialog opens and you can choose options for saving the current diagram. The options available vary based on the current lock mode of the diagram.

To close the diagram, choose the appropriate options in the Close Options group box and click OK. The available options include:

•	Save to ModelMart. Click this button to save the diagram to the ModelMart before closing.

•	Save as .ER1 File. Click this button to save the diagram as an .er1 file before closing.

•	Close without saving. Click this button to close the diagram without saving.

•	Keep ModelMart snapshot for later merge. Select this check box to work remotely on a ModelMart diagram and later merge your changes back to the ModelMart. This check box is enabled when you choose the Save as .er1 file option described earlier.

•	Keep ModelMart Diagram Lock. Select this check box if you want to keep the lock on the current diagram after closing.

The Status area text includes the current status of the diagram such as, how the diagram was opened; for example, server or local, the current lock mode, and whether there are unsaved changes.

By default, ERwin unlocks a diagram when you close it. If you want to keep the lock, select the Keep ModelMart Diagram Lock check box. If you choose to keep a diagram locked after you close it, your work session is still considered active even if you disconnect from ModelMart and work off site on an .er1 file.

If necessary, the ModelMart Administrator can unlock the diagram using the ModelMart Session Manager. See Managing ModelMart Sessions  for more information.

Note:	You can Save to ModelMart and lock a diagram only if no other user has a locked copy of the diagram. See Using ModelMart Diagram Locking Options  for more information.

Related Topics

  To close a ModelMart diagram

  Summary of Close Diagram Options


To close a ModelMart diagram

1.	Choose Close ModelMart Diagram on the ModelMart menu.

2.	Choose the appropriate option(s) in the Close Options group box:

•	Click the Save to ModelMart button to save your changes to the ModelMart.

•	Click the Save as .ER1 File button to save the diagram as an .er1 file.

•	Click the Save as .ER1 File button and select the Keep ModelMart Snapshot for Later Merge check box to work remotely on a ModelMart diagram and later merge your changes back to the ModelMart.

•	Click the Close without saving button to close the diagram without saving.

3.	Select the Keep ModelMart Diagram Lock box to close the ModelMart diagram and keep it locked so that other users cannot save their changes.

4.	Click OK. ERwin opens the appropriate dialogs so you can save your changes to the ModelMart, save a snapshot, and save the diagram as an .er1 file, then it closes the diagram.

Note:	If there are no differences between your workstation copy and the master version of the ModelMart diagram, the Save to ModelMart option is dimmed and unavailable.


Summary of Close Diagram Options

The following chart explains the Close options in the Close ModelMart Diagram dialog.

If You Choose…	And the Lock Mode or Save Status is…	Then ERwin…
Save to ModelMart	Locked, with unsaved changes.	Opens the appropriate dialog to let you save your changes to the ModelMart. After you save, ERwin reopens the Close ModelMart Diagram dialog and changes the status to “locked and up-to-date.”
	Locked, up-to-date.	Immediately saves, unlocks, and closes the diagram. If you select the Keep ModelMart Diagram Lock option, ERwin keeps the diagram locked and your current session open, which prevents other users from saving their changes to the same diagram.
	Unlocked, with unsaved changes.	Opens the appropriate dialog to let you save your changes to the ModelMart. After you save, ERwin reopens the Close ModelMart Diagram dialog and changes the status to “unlocked and up-to-date.” Not available if diagram is locked by another user.
Save as .ER1 File	Locked or unlocked, up-to-date, or with unsaved changes.	Saves the diagram as an .er1 file (same as File Save As).
Keep ModelMart Snapshot for Later Merge	Unlocked, up-to-date, or with unsaved changes.	Saves the ModelMart diagram as an .er1 file and creates a snapshot copy of the original diagram. You can rename the snapshot in the Save Snapshot As box.
Close without Saving	Locked or unlocked, up-to-date, or with unsaved changes.	Closes the diagram without saving any changes.
Keep ModelMart Diagram Lock	Locked, up-to-date, or with unsaved changes.	Locks the diagram.
	Unlocked, up-to-date, or with unsaved changes.	Locks the diagram if it is not already locked by another user.
Summary of Close ModelMart Diagram Options


Using Multiple ModelMarts

Each ModelMart installation supports one ModelMart. If you want to store ERwin diagrams or BPwin models in more than one ModelMart at your site, you must purchase additional copies of ModelMart. To transfer a diagram or model from one ModelMart to another, first save the diagram or model as a file, then log on to the DBMS that contains the ModelMart, open the file, and save it in the new ModelMart.

Related Topics

  To move a diagram or model from one ModelMart to another


To move a diagram or model from one ModelMart to another

1.	Open ERwin on a workstation that lets you log on to the source ModelMart.

2.	Click the Open ModelMart Model [image] button on the ModelMart toolbar or choose Open ModelMart Diagram on the ModelMart menu, then select the diagram that you want to move to the target ModelMart.

3.	Choose Close ModelMart Diagram on the ModelMart menu. ERwin opens the Close Diagram dialog. Select the Save as ER1 button to save the diagram as an .er1 file, then click OK. ERwin opens the Save As dialog. Specify the pathname where you want to save the .er1 file (choose a location that can be accessed by a computer connected to the target ModelMart). Type a name for the .er1 file and click OK.

4.	Open ERwin on a workstation that lets you log on to the target ModelMart, that is, the ModelMart in which you want to save the diagram.

5.	Choose Open on the File menu to open the .er1 file.

6.	Click the Save ModelMart Model [image] button on the ModelMart toolbar or choose ModelMart Save As on the ModelMart menu and save the file to the target ModelMart.

Note:	You cannot move a ModelMart diagram directly from one ModelMart to another. See Saving a ModelMart Diagram as an ER1 File  and Saving a ModelMart Diagram under Another Name  for more information.

You can merge a diagram into a target diagram in a different ModelMart by saving it as an .er1 file and then following the merge procedure. See Merging Independent Diagrams  for more information.


How ModelMart Supports Submodeling

If you are working with large ModelMart diagrams containing 100 entities or more, the time it takes to load diagram objects, perform incremental saves, or diagram merges is significant. To improve the response time when accessing ModelMart, you can divide a large model into a number of smaller submodels and access them independently of the parent diagram. Typically, you create a separate submodel for each business unit or process. Each submodel contains only those entities and relationships relevant to that business unit or process. For security reasons, you may also consider creating a submodel for access only by users with a specific security profile.

ERwin implements submodeling using subject areas. When you save an .er1 diagram to the ModelMart, each subject area automatically becomes a ModelMart subject area (submodel). You can use the ModelMart Subject Area Manager to create, update, and delete ModelMart subject areas. A ModelMart subject area is similar to an ERwin diagram subject area except that you can work with a ModelMart subject area independently of its parent diagram and later merge any changes you made back into the parent diagram in the ModelMart.

Note:	You can also use the standard ERwin Subject Area Editor to create, update, and delete subject areas in a open ModelMart diagram. See Working with Subject Areas  for more information. However, when you open a ModelMart subject area, the Subject Area Editor is disabled so that you cannot create a new ModelMart subject area within an existing one.

Related Topics

  Creating a Subject Area in a ModelMart Diagram

  Renaming a ModelMart Subject Area

  Deleting a Subject Area from a ModelMart Diagram

  Opening a ModelMart Subject Area

  Saving ModelMart Subject Area Changes to the ModelMart

  Closing a ModelMart Subject Area

  Working with a ModelMart Subject Area Offline

  Submodeling and Security


Creating a Subject Area in a ModelMart Diagram

When you save an .er1 diagram to the ModelMart, the subject areas in the .er1 diagram automatically become ModelMart subject areas in the corresponding ModelMart diagram.

You can also create new subject areas. To do this, you do not necessarily need to have a ModelMart diagram open. When you choose the ModelMart Subject Area Manager on the ModelMart menu, ERwin opens the ModelMart Subject Area Manager dialog and you can access all the diagrams and subject areas in the ModelMart. To create a subject area, you simply select a diagram in the tree control, type a name for the subject area in the edit control, and click the Create SA button. ERwin creates the subject area and adds it to the tree control.

After you create the subject area, you can specify the entities that you want to include. Click on the subject area you just created. The Entities in Diagram box shows all the entities in the parent diagram. You can drag entities from the Entities in Diagram box to the Entities in Subject Area box or vice-versa.

You can also check the Include Parents and Children box if you also want to move parent and child entities when you move an entity from the Entities in Diagram list to the Entities in Subject Area list or vice-versa.

When the Entities in Subject Area box contains the entities you want to include in your subject area, click OK.

ERwin treats the creation of a ModelMart subject area just like any other change to a ModelMart diagram. When you save the diagram to ModelMart, ERwin opens the Review Changes dialog and you can review your changes to the diagram before committing them to the ModelMart. See Reviewing Changes When Saving a Diagram to the ModelMart  for more information.

Related Topics

  To create a subject area using the ModelMart Subject Area Manager

  To specify the entities in a ModelMart subject area


To create a subject area using the ModelMart Subject Area Manager

1.	Click the Manage ModelMart Subject Area button [image] on the ModelMart toolbar or choose ModelMart Subject Area Manager on the ModelMart menu.

2.	Double-click the library icon in the tree control that contains the diagram you want to add a subject area to, then click on the diagram you want.

3.	Type the name of the subject area you want to add in the Subject Area Name box. ERwin enables the Create SA button.

4.	Click the Create SA button. ERwin adds the subject area icon to the tree control.


To specify the entities in a ModelMart subject area

1.	Click the Manage ModelMart Subject Area button [image] on the ModelMart toolbar, or choose ModelMart Subject Area Manager on the ModelMart menu.

2.	Click on the subject area you want to select in the tree control. ERwin populates the Entities in Diagram and Entities in Subject Area lists in the ModelMart Subject Area Manager dialog.

3.	Specify entities for the selected subject area as follows:

•	To add an entity to a subject area, drag the entity you want from the Entities in Diagram list to the Entities in Subject Area list. The cursor changes to [image] to indicate that you can drop the diagram entity in the selected area.

•	To remove an entity from a subject area, drag the entity you want to remove from the Entities in Subject Area list to the Entities in Diagram list. The cursor changes to [image] to indicate that you can drop a subject area entity in the selected area.

4.	Select the Include Parents and Children check box if you also want to migrate parent and child entities when you move an entity from the Entities in Diagram list to the Entities in Subject Area list or vice-versa.

5.	Click OK when the Entities in Subject Area list contains the entities you want. ERwin opens the Review Changes dialog and you can review the changes you have made to the parent diagram before you commit them to the ModelMart.

Note:	In Step 3, the cursor changes to [image] (the prohibited symbol) when you position it over an area in which the entity cannot be dropped.

In Step 3, an alternative way to move an entity from the Entities in Diagram list to the Entities in Subject Area list or vice versa, is to select the entity and click either the [image] or [image] button.


Renaming a ModelMart Subject Area

You can use the ModelMart Subject Area Manager to rename a subject area in a ModelMart diagram. To do this, you do not necessarily need to have a ModelMart diagram open. When you choose ModelMart Subject Area Manager on the ModelMart menu, ERwin opens the ModelMart Subject Area Manager dialog and you can access all the diagrams and subject areas in the ModelMart. To rename a subject area, simply select the subject area in the tree control, click in the edit control at the top of the dialog, type the new name, and click the Rename SA button. ERwin renames the subject area and updates the tree control.

ERwin treats the renaming of a subject area just like any other diagram change, therefore, the subject area is not actually renamed until you click OK and commit the diagram changes to the ModelMart. See Reviewing Changes When Saving a Diagram to the ModelMart  for more information.

Related Topics

  To rename a ModelMart Subject Area


To rename a ModelMart subject area

1.	Click the Manage ModelMart Subject Area button [image] on the ModelMart toolbar, or choose ModelMart Subject Area Manager on the ModelMart menu.

2.	Click on the subject area you want in the tree control. ERwin populates the Entities in Diagram and Entities in Subject Area lists.

3.	Edit the existing name, or type an new name in the Subject Area Name box.

4.	Click the SA Rename button. ERwin renames the subject area icon in the tree control.


Deleting a Subject Area from a ModelMart Diagram

You can use the ModelMart Subject Area Manager to delete a subject area from a ModelMart diagram. To do this, you do not necessarily need to have a ModelMart diagram open. When you choose ModelMart Subject Area Manager on the ModelMart menu, ERwin opens the ModelMart Subject Area Manager dialog and you can access all the diagrams and subject areas in the ModelMart. To delete a subject area, simply select the subject area in the tree control and click the Delete SA button. ERwin deletes the subject area from the tree control.

ERwin treats the deletion of a subject area just like any other diagram change, therefore, the subject area is not actually deleted until you click OK and commit the diagram changes to the ModelMart. See Reviewing Changes When Saving a Diagram to the ModelMart  for more information.

Related Topics

  To delete a subject area using the ModelMart Subject Area Manager


To delete a subject area using the ModelMart Subject Area Manager

1.	Click the Manage ModelMart Subject Area button [image] on the ModelMart toolbar or choose ModelMart Subject Area Manager on the ModelMart menu.

2.	Double-click the subject area in the tree control that you want to delete. ERwin populates the Entities in Diagram and Entities in Subject Area lists and enables the Create SA, Rename SA, and Delete SA buttons.

3.	Click the Delete SA button. ERwin removes the subject area icon from the tree control.

4.	Click OK. ERwin opens the Review Changes dialog and you can review the changes you have made as a result of deleting the subject area before committing them to the ModelMart.


Opening a ModelMart Subject Area

You can open a ModelMart subject area independently of its parent ModelMart diagram. When you choose Open ModelMart Diagram on the ModelMart menu, ERwin opens the Open ModelMart Diagram dialog. If you click on a library in the ModelMart library list, it shows all the ModelMart diagrams and subject areas in the selected library. Choose a Lock Option, then double-click on the ModelMart subject area you want to open.

See Opening a ModelMart Diagram  for more information about the lock options.

Related Topics

  To open a ModelMart subject area

  Working with Multiple Submodels


To open a ModelMart subject area

1.	Click the Manage ModelMart Subject Area button [image] on the ModelMart toolbar or choose Open ModelMart Diagram on the ModelMart menu.

2.	Click on the library that contains the model and subject area you want.

3.	Choose one of the options in the Lock Option group box.

4.	Double-click on the subject area. ERwin opens the subject area in a separate diagram window. The name in the title bar identifies the subject area in the format: <library>..<diagram.er1>..<subject area>

Note:	When ERwin opens a ModelMart subject area, it loads only the ModelMart objects related to the subject area. This includes the objects for all entities and attributes in the subject area and the objects for any entities and attributes outside but related to the ModelMart subject area, for example, foreign key attributes.


Saving ModelMart Subject Area Changes to the ModelMart

You can open and work with a ModelMart subject area independently of the ModelMart diagram that contains the subject area. You can make changes to a ModelMart subject area in two ways:

•	By changing the membership of entities in the subject area using the ModelMart Subject Area Manager. See To specify the entities in a ModelMart Subject Area  for more information.

•	By using ERwin standard features to add, delete, or update model components.

Typically, when you make changes to a ModelMart subject area, you want to merge those changes back into the parent diagram in ModelMart. Choose Save to ModelMart on the ModelMart menu. ERwin opens the Save Diagram to ModelMart dialog that:

•	Indicates if the Auto Archive option is enabled for the library you are saving the subject area to. If the Archive Original Version check box is selected, ERwin automatically generates an archive of the parent diagram before merging your changes to the ModelMart. See Managing ModelMart Libraries and Diagrams  for more information.

•	Provides you with the option of reviewing your changes. Select the Review All Changes Before Save check box if you want to review your changes before merging them into the master diagram in the ModelMart.

Related Topics

  To save subject area changes to the ModelMart


To save subject area changes to the ModelMart

1.	Click the Save diagram changes in ModelMart button [image] on the ModelMart toolbar or choose Save to ModelMart on the ModelMart menu.

2.	Select or clear the Review All Changes Before Save check box depending on whether you want to review your changes or not before committing them to the ModelMart.

3.	Click OK. If you selected the Review All Changes Before Save option, ERwin opens Review Changes dialog. Review your changes, then click OK.

ERwin commits your changes to the parent diagram in the ModelMart.

Note:	The Archive Original Version check box in the Save Diagram to ModelMart dialog is always dimmed. If this check box is selected, ERwin automatically saves an archive of the parent diagram to the ModelMart. If this check box is cleared, ERwin does not save an archive of the parent diagram. You can set this option at the ModelMart library level. See Managing ModelMart Libraries and Diagrams  for more information.


Closing a ModelMart Subject Area

If you have a ModelMart subject area open, and you choose Close ModelMart Diagram on the ModelMart menu, ERwin opens the Close ModelMart Diagram dialog so that you can choose options for saving the ModelMart subject area.

The options for closing a ModelMart subject area are the same as the options for closing a ModelMart diagram. The available options are:

•	Save to ModelMart. Click this button to save ModelMart subject area changes to the parent diagram in the ModelMart.

•	Save as .ER1 File. Click this button to save the ModelMart subject area as an independent .er1 file before closing.

•	Keep ModelMart Snapshot for Later Merge. Select this check box to work remotely on a ModelMart subject area and later merge your changes back to the parent diagram in the ModelMart. This option is enabled when you choose the Save as .ER1 File option. See Working with a ModelMart Subject Area Offline  for more information.

•	Close without Saving. Click this option to close the ModelMart subject area without saving your changes.

The Status area shows the current status of the ModelMart subject area including how the subject area was opened (that is, server or local), the current lock mode, and whether there are unsaved changes.

Related Topics

  To close a ModelMart subject area


To close a ModelMart subject area

1.	Choose Close ModelMart Diagram on the ModelMart menu.

2.	Choose the appropriate option(s) in the Close Options group box:

•	Click the Save to ModelMart button to save your ModelMart subject area changes to the ModelMart.

•	Click the Save as .ER1 File button to save the ModelMart subject area as an independent .er1 diagram.

•	Click the Save as .ER1 File button and select the Keep ModelMart Snapshot for Later Merge check box to work remotely on a ModelMart subject area and later merge your changes back to the ModelMart.

•	Click the Close without Saving button to close the diagram without saving any changes.

3.	Click OK. ERwin opens the appropriate dialogs to let you save your changes to the ModelMart, save a snapshot, or save the diagram as an .er1 file, then it closes the diagram.

Note:	If there are no differences between your copy and the master version of the ModelMart subject area, the Save to ModelMart button is unavailable (dimmed).


Working with a ModelMart Subject Area Offline

Just as you can work with a ModelMart diagram without direct and continuous access to the ModelMart, you can also work offline with a ModelMart subject area. To do this, open the ModelMart subject area you want, then choose Close ModelMart diagram on the ModelMart menu to access the save options.

In the Close ModelMart Diagram, you must select the following options:

•	Save as .ER1 File. Click this button to create an .er1 file of the ModelMart subject area you want. This is the file you can take offline and modify without a connection to ModelMart.

•	Keep ModelMart Snapshot for Later Merge. Check this option to create a snapshot of the current state of the ModelMart subject area. This is the file that ERwin uses when you merge your .er1 file changes back into the ModelMart. ERwin uses the snapshot file to detect not only the changes that you have made but also the changes that other modelers have made since the snapshot was taken.

When you click OK, ERwin first opens the ModelMart Snapshot dialog to let you name the snapshot then opens the ERwin Save As dialog and you can save the .er1 file. See Saving a ModelMart Diagram as an .ER1 File  for more information.

You can now work on your .er1 diagram (the ModelMart subject area) offline.

Once you complete your changes, typically, you want to merge them back to the parent diagram in the ModelMart. When you open your .er1 diagram and choose Save to ModelMart on the ModelMart menu, ERwin detects that a snapshot corresponding to your .er1 file exists and opens the Save to ModelMart Using Snapshot dialog.

You can use the default snapshot that ERwin created when you save the diagram as an .ER1 file or you can select another snapshot in the Snapshot box. This feature is useful if the original snapshot is inadvertently deleted from the ModelMart.

When the Snapshot box shows the snapshot you want to use, choose one of the following options:

•	Yes. ERwin compares the snapshot with:

•	Your .er1 file, that is, any changes you have made to the diagram since the snapshot.

•	The parent diagram in the ModelMart, including any changes that other modelers have made since you saved the snapshot.

If ERwin detects differences between your .er1 file and the snapshot, it opens the ModelMart Change Control Manager - Review Changes dialog and you can accept or reject the changes before committing them to the ModelMart.

If ERwin detects differences between your .er1 file and the parent diagram, and differences between the snapshot and the parent diagram in the ModelMart, it opens the ModelMart Change Control Manager - Conflict Resolution dialog and you can resolve any conflicts before committing changes to the ModelMart. See Using the ModelMart Change Control Manager for more information.

•	No. ERwin opens the Save ModelMart Diagram As dialog and you can save your .er1 file to the ModelMart under a different name. See Saving a ModelMart Diagram Under Another Name for more information.

•	Cancel. ERwin cancels the merge operation and returns to your .er1 file.

Related Topics

  To create an .ER1 file for working offline

  To merge your offline .ER1 changes back to ModelMart


Working with Multiple Submodels

For large models, working with multiple subject areas provides time saving advantages over working with the complete ModelMart diagram since ERwin loads (from ModelMart) only the objects it needs for the subject areas you select.

You can open and work with two or more ModelMart diagram subject areas (submodels) without opening the parent ModelMart diagram. Once you select a library in the Open ModelMart Diagram dialog, you can use CTRL+click or SHIFT+click to select two or more subject areas in the same ModelMart diagram. When you click OK, ERwin opens a new diagram that includes only the subject areas you selected. You can work on each subject area and merge your changes back into the master diagram in the ModelMart just as if you had the complete ModelMart diagram open.

When you open multiple subject areas in a single diagram, the name shown in the most recently used (MRU) file list is the name of the first subject area in your selection followed by the plus sign (+).

Related Topics

  To open multiple ModelMart subject areas


To open multiple ModelMart subject areas

1.	Click the Open ModelMart diagram button [image] on the ModelMart toolbar, or choose Open ModelMart Diagram on the ModelMart menu.

2.	Click on the library that contains the diagram you want to work on in the ModelMart Library list.

3.	Choose one of the following:

•	Use SHIFT+click to select a range of ModelMart subject areas that you want to open.

•	Use CTRL+click to select the individual ModelMart subject areas that you want to open.

4.	Click OK. ERwin opens the ModelMart subject areas you selected in a single diagram.


Submodeling and Security

One of the benefits of submodeling is the ability to apply a security level to a subject area to control the actions a user can perform on the objects in that subject area. See Using ModelMart Security Features  for more information.

When you work with a ModelMart diagram that has subject areas, security is enforced by comparing the security level of the diagram with the security level of each subject area. If there are conflicting security levels, the most restrictive security level prevails.

For example, consider the diagram with two subject areas (submodels) shown in the example below.

Note:	In the example above, the Modeler and Viewer security profiles are the default ModelMart security profiles. The Viewer profile is more restrictive than the Modeler profile.

If you open the diagram, make changes to the E1 and E5 entities, then save the changes to the ModelMart, the following occurs:

•	The E1 changes are canceled. To enforce security, ModelMart considers the security level of both the diagram and all subject areas. The most restrictive security level prevails, in this case, Viewer security in Subject Area 1.

•	The E5 changes that migrate to E1 through the relationship between E5 and E1 are canceled since E1 cannot be updated for security reasons.

•	The E5 changes that do not migrate to E1 can be accepted.

When you are working directly with a ModelMart subject area, only the security level restrictions for that subject area are enforced.


The Report Browser Workplace

The main Report Browser window is divided into six areas as follows:

•	Menu Bar. Contains menus for accessing Report Browser functions. See Report Browser Menu Options and Toolbar Controls  for more information.

•	Toolbar. Contains a number of buttons and a list for the currently selected result set. This list displays the twenty most recently generated reports or report views. See Report Browser Menu Options and Toolbar Controls  for more information.

•	Tree Control. Shows the various reports and corresponding result sets in a hierarchical structure. The caption bar above the tree control shows the currently selected root node of the tree. See Tree Control  for more information.

•	Result Set Area. Displays the actual result set generated by a report. The caption bar above the result set area displays information about the currently displayed result set.

•	Description Area. Shows a description of the currently selected report or customized report view. For ERwin reports, the description in this area is the same as the description you enter on the Definition Tab of the ERwin Report Editor when you are creating or editing an ERwin report.

•	Tree Control Toolbar. Contains four buttons for managing the items in the tree control. See Navigating and Managing the Tree Control  for more information.

Related Topics

  Report Browser Menu Options and Toolbar Controls


Report Browser Menu Options and Toolbar Controls

The menu bar and toolbars in the main Report Browser window provide the controls you can use to generate and work with reports. When you position the cursor over a toolbar button, ToolTip text explaining the function of the toolbar button displays.

You can use the Tree Control Toolbar, located below the Description area to customize your view of the tree, delete items in the tree control, or edit ERwin reports.

Related Topics

  Summary of Report Browser Menu Options and Toolbar Controls


Summary of Report Browser Menu Options and Toolbar Controls

The table below briefly explains the purpose of each Report Browser menu option, identifies the corresponding toolbar control, and explains where to get more information. Not every menu option has a corresponding toolbar control and vice-versa.

Menu	Option	Toolbar Control	Use this option or control to:
File	New ERwin Report		Create a new ERwin report or a new folder.
File	New Folder		Create a new report folder. See To create a new report folder  for more information.
File	Save View		Save a customized view of a report. See Saving a Report View  for more information.
File	Execute Report		Generate the selected report.
File	Save Changes		Save changes to a cell in an editable report.
		Most recently generated reports list.	Displays the name of the currently selected report or report view. You can choose one of the 20 most recently generated reports or report views, then click the execute report button to generate it.
File	Print		Print the selected result set. See Printing a Result Set  for more information.
File	Print Preview		Preview a result set before printing. See Previewing a Result Set  for more information.
File	Export		Export a result set in CSV or HTML format or export to RPTwin, or to an application that supports DDE. See Exporting a Result Set  for more information.
File	Exit		Exit the Report Browser.
Edit	Report Format		Specify the column and sort options for a result set. See Specifying Column Options for a Result Set  and Specifying Column Sort Order and Sort Type  for more information.
			Edit the selected ERwin report.
Edit	Icons		Assign icons to values in a result set. See Assigning an Icon to a Result Set Value  for more information.
Edit	Copy		Copy the current result set to the Windows Clipboard.
Edit	Paste		Paste text from the Clipboard into a cell in an editable report.
Edit	Delete		Delete the selected report, report format, or empty report folder.
Search	Find		Specify search conditions for the current result set and find the rows that satisfy them. See Finding Items in a Result Set  for more information.
			Find the next row in the result set that satisfies the current search conditions. See Finding Items in a Result Set  for more information.
Search	Available Reports		Show the reports available to the selected result set row. See Using a Result Set Row to Generate a Report  for more information.
View	Folders		Display/Hide the tree control.
View	Reports by Category		Display the reports by category. When you choose this item, the General folder becomes the root node of the tree control. The ModelMart <NAME> folder is hidden. See Using the Report Browser with ModelMart  for more information.
View	Reports by ModelMart Object		Display the reports by ModelMart object. When you choose this item, the ModelMart <NAME> folder becomes the root node of the tree control. The General folder is hidden. See Using the Report Browser with ModelMart  for more information.
View	History		Display all the result sets generated during the current ERwin and ModelMart sessions, in chronological order. See To display a history of generated result sets  for more information.
			Display the result set that supplied the parameter values used to generate the currently displayed result set. See Using a Result Set Row to Generate a Report  for more information.
ERwin Reports	New Report File		Create a new ERwin Reports (.erp) file that does not include any existing ERwin Reports.
ERwin Reports	Open Report File		Open a different ERwin Reports (.erp) file.
ERwin Reports	Save Report File As		Save your ERwin reports to a new ERwin Reports (.erp) file.
ERwin Reports	Copy Report to ModelMart		Save the currently selected report in ModelMart as a shared ERwin report so that it is available to all ModelMart users.
ERwin Reports	Copy Report to Local File		Save the currently selected shared ERwin report in the ERwin Reports (.erp) file.
Help	About Report Browser		Display general information about the Report Browser.
			Collapse the tree to show only the top-level folders. See To collapse all open folders in the tree control  for more information.
			Make the selected folder the root of the tree. See To make the selected folder the root node  for more information.
			Make the parent folder of the selected folder the root of the tree. See To move the root node up one level  for more information.


Tree Control

The tree control displays the Report Browser reports and result sets as an indented outline based on their logical hierarchical relationship. The caption bar above the tree control shows the currently selected root node of the tree.

When you are using ERwin without a ModelMart connection, the tree control shows one node called ERwin Reports <ERP filename>. This is the base node for a hierarchy of folders containing existing ERwin reports, customized report views, and result sets. When you click the expand symbol [image] next to the ERwin Reports node, it expands to show folders of predefined reports organized by category. The Report Browser shows a folder for each report category in which one or more reports exist. Click the expand symbol next to a report category folder to view the reports in that category.

The meaning of each tree control symbol is shown below:

•	 Report Folder

•	 Report

•	 Editable Report

•	 Result Set

•	 Report View

Related Topics

  Shortcut Menus for Tree Control Objects


Shortcut Menus for Tree Control Objects

The Report Browser provides shortcut menus for the objects displayed in the tree control. The table following shows the shortcut menu options for each object type:

Object Type	Shortcut Menu Options	Function
Folder ( [image]) (user created folders only)	Rename ‘<folder name>’	Enables you to edit the <folder name>.
Report ( [image]) or Editable Report ( [image])	Edit ERwin Report ‘<report name>’	Opens the ERwin Report Editor dialog.
	Execute Report ‘<report name>’	Run the selected report.
	Rename ‘<report name>’	Enables you to edit the selected <report name>.
Result set ( [image])	Edit report format for ‘<report name>’	Opens the Report Format dialog.
	Print result set ‘<result set name>’	Sends the selected result set to a local printer.
	Preview result set ‘<result set name>’	Opens the Print Preview dialog.
	Rename ‘<result set name>’	Enables you to edit the selected <result set name>
View ( [image])	Execute report ‘<report view name>’	Generate a report in a format defined by the view.
	Rename ‘<report view name>’	Enables you to edit the selected <report view name>
Related Topics

  Navigating and Managing the Tree Control


Navigating and Managing the Tree Control

You can customize what you see in the tree control using a variety of controls and toolbar buttons. You can:

•	Expand ( [image]) or collapse ( [image]) each folder.

•	Collapse all open folders.

•	Make any folder the root node of the tree control.

•	Move the root up one level, that is, make the parent of the current root the new root of the tree. The Make Parent Folder the Root button [image] is not available (dimmed) when the complete tree is visible (that is, when the tree control caption is "All reports").

•	Create a new report folder.

•	Delete a report ( [image]), a customized report view ( [image]), a result set ( [image]), or an empty report folder ( [image]).

The tree control toolbar below the description area in the main window contains a number of buttons to help you manage the items in the tree control. See Summary of Menu Options and Toolbar Controls  for more information.

Related Topics

  Shortcut Menus for Tree Control Objects

  To display all report folders

  To collapse all open folders in the tree control

  To make the selected folder the root node

  To move the root node up one level

  To create a new report folder

  To delete an item from the tree control


To display all report folders

•	Click the [image] button until the button is dimmed.

Note:	You do not have to select the current root before you click the [image] button.


To collapse all open folders in the tree control

•	Click the [image] button. The tree control shows only the first level of folders.


To make the selected folder the root node

1.	Click on the folder in the tree control that you want to make the root node.

2.	Click the [image] button. The folder you selected becomes the root node.


To move the root node up one level

•	Click the [image] button. The parent folder of the currently selected root node becomes the new root node of the tree.


To create a new report folder

1.	Click on the folder where you want to insert the new folder.

•	If you want the new folder to be at the same level as the selected folder, make sure the selected folder is collapsed, that is, has a [image] symbol next to it.

•	If you want the new folder to be a child of the selected folder, click on the [image] symbol next the selected folder to expand it.

2.	Choose New Folder on the File menu. The Report Browser adds a new folder to the tree control. By default, the folder is assigned the name New Folder.

3.	Type a new name and press ENTER.


To delete an item from the tree control

1.	Click on the item in the tree control that you want to delete.

2.	Click the [image] button. The selected item is deleted.

Note:	A folder must be empty before you can delete it.

You cannot delete a ModelMart object.

You can delete a predefined report in the General or ModelMart <Name> folder to remove it from the tree control, but it remains in the ModelMart and other users can access it when they open the Report Browser.


Displaying a History of Result Sets

You can display a list of all the result sets generated in the current ERwin and ModelMart sessions in chronological order. When you choose History on the View menu, or click the Display browser history button [image], the Report Browser open the Result set History dialog so that you can choose to display or delete one or more of the result sets generated during the current ERwin or ModelMart session.

When you double-click on a result set in the History dialog, the result set is displayed in the Result set area and the icon for that result set is highlighted in the tree control. This is an easy way to locate the result set icon that corresponds to a result set.

The purpose of each control in the Result Set History dialog is explained below:

•	Result set list. Lists the result sets generated during the current ERwin and Modelmart sessions in chronological order.

•	Display. Displays the result set selected in the result set list.

•	Delete. Deletes the result set selected in the result set list.

•	Close. Closes the dialog.

Related Topics

  To display a history of generated result sets


To display a history of generated result sets

1.	Click the [image] button or choose History on the View menu to open the Result Set History dialog.

2.	Select the result set you want to view.

3.	Choose one or more of the following options:

•	To view the result set in the Browser, click the Display button. The Report Browser displays the selected result set and selects the result set icon in the tree control.

•	To delete the result set, click the Delete button.

4.	Click the Close button to close the Result Set History dialog.


Customizing a Result Set View

You can change the formatting of the result set displayed in the Browser, including:

•	The order in which columns are displayed.

•	The appearance of each column (visible or hidden, bold, grayed).

•	The column headings.

•	The order in which the rows are displayed.

•	Whether or not certain rows are displayed. See Finding Items in a Result Set  for more information.

•	The icons associated with report values. See Assigning an Icon to a Result Set Value  for more information.

Once you have made your changes and you are satisfied with the way the results are presented, you can save them in a named report view. The report view ( [image]) appears in the tree control, and you can generate it just like a predefined report. This means that the work of developing an effective presentation needs to be done only once. A single report can have many views, and you can switch between views without regenerating your result set. See Saving a Report View  for more information.

Related Topics

  Specifying Column Options for a Result Set

  Specifying Column Sort Order and Sort Type

  Assigning an Icon to a Result Set Value

  Finding Items in a Result Set

  Hiding Rows That Do Not Match the Search Criteria


Specifying Column Options for a Result Set

When you choose Report Format on the Edit menu, or click the [image] button in the toolbar, the Report Browser displays the column and sort options dialog. Using the controls in the Column Options tab, you can customize your view of the result set to:

•	Select only the columns that you want in the result set.

•	Change the order of columns in the result set.

•	Change the appearance of the columns in a result set.

•	Change the heading for a result set.

The purpose of each control in the Column Options tab is explained below:

•	Column. Displays the columns in the selected report. Select the check box next to each column you want to include in the result set. Clear the check box next to each item you do not want to appear in the report. The option selected in the Option list described below determines the display characteristics of the selected columns in the Columns list.

•	Move Up. Click this button to move the currently selected column up one place in the Column list.

•	Move Down. Click this button to move the currently selected column down one place in the Column list.

•	Heading. Click this button to open the Column Heading dialog. You can edit the column heading for the currently selected column.

•	Option. Select a column display option, then select the check box next to each column in the Column list to which you want to apply the option. The options are:

•	Visible. Select the check box next to each column in the list that you want to be displayed. Clear the check box next to the columns you want hidden.

•	Popup. Select to display the content of a column in a popup box.

•	Bold. Select the check box next to each column in the list that you want to be bold.

•	Grayed. Select the check box next to each column in the list that you want to be grayed.

Related Topics

  To select the columns to include in the result set

  To change the order of columns in a result set

  To change the appearance of one or more columns in a result set

  To change a column heading in a result set


To select the columns to include in the result set

1.	Double-click on a report to display the result set.

2.	Click the [image] button in the toolbar or choose Report Format on the Edit menu to open the column and sort options dialog.

3.	Click on the Column Options tab if not already selected.

4.	Choose the Visible option in the Option list.

5.	Select the check box next to each column that you want to appear in the result set.

6.	Click OK. The Report Browser redisplays the result set, which now contains only the columns you specified.


To change the order of columns in a result set

1.	Double-click on a report to display the result set.

2.	Click the [image] button in the toolbar or choose Report Format on the Edit menu to open the column and sort options dialog.

3.	Click on the Column Options tab, if not already selected.

4.	Click on a column, then click the Move Up or Move Down buttons to move the column to the position you want in the result set view.

5.	Repeat Step 3 above for other columns until you get the column order you want in the result set view.

6.	Click OK. The Report Browser redisplays the result set with the columns in the order you specified.


To change the appearance of one or more columns in a result set

1.	Double-click on a report to display the result set.

2.	Click the [image] button in the toolbar or choose Report Format on the Edit menu to open the column and sort options dialog.

3.	Click the Column Options tab.

4.	Select the column display option in the Option list (for example, Bold).

5.	Select the check box next to each column to which you want to apply the column display option. Clear the check box next to each column to remove the display option from that column.

6.	Optionally, repeat Steps 3 and 4 to apply another column display option to a column (for example, Grayed).

7.	Click OK. The Report Browser redisplays the result set which shows the columns with the new column display options applied.


To change a column heading in a result set

1.	Double-click on a report to display the result set.

2.	Click the [image] button in the toolbar or choose Report Format on the Edit menu to open the column and sort options dialog.

3.	Click the Column Options.

4.	Click the column name that you want to change.

5.	Click the Heading button to open the Column Heading dialog.

5.	Type the heading that you want to assign to the result set column in the Column Heading box.

6.	Click OK. The Report Browser displays the result set with the column heading you assigned.


Specifying Column Sort Order and Sort Type

When you choose Report Format on the Edit menu or click the Options button [image] in the toolbar, the Report Browser displays the column and sort options dialog. Using the controls in the Sort tab, you can customize your view of the result set by:

•	Sorting the result set on a specific column and changing the sort type (ascending or descending) for that column.

•	Sorting on more than one column.

•	Changing the order of the sorted columns.

The purpose of each control in the Sort tab is explained below:

•	Columns. Select the check box next to each column that you want to sort in the result set rows. The columns you select are placed in the Sort Columns list.

•	Sort Columns. Shows the columns in the result set rows that are sorted, the sort type (ascending [image] or descending [image]) for each column, and the order in which column sorting is done when sorting on more than one column. The first column in the list is sorted first, the second column is sorted second, and so on.

•	Move Up. Click this button to move the selected column up one place in the Column Sort list.

•	Move Down. Click this button to move the selected column down one place in the Sort Columns list.

•	Ascending. Click this button to sort the selected column in ascending order.

•	Descending. Click this button to sort the selected column in descending order.

Related Topics

  To sort a result set on one or more columns


To sort a result set on one or more columns

1.	Double-click on a report to display the result set.

2.	Click the [image] button in the toolbar or choose Report Format on the Edit menu to open the column and sort options dialog.

3.	Click on the Sort tab.

4.	Select the check box next to the column in the Columns list box that you want to sort in the result set. The Report Browser displays the column you select in the Sort Columns list. By default, each new sort column is automatically assigned an ascending order sort type indicated by the [image] symbol next to the column.

5.	Repeat Step 4 for each column that you want to sort on.

6.	Optionally, select a column in the Sort Columns list and click the order type button (ascending [image] or descending [image]) to change the sort order type for the selected column.

7.	Repeat Step 6 for each column that you want to sort on.

8.	Click OK. The Report Browser displays the result set with the sort order you specified.

Note:	You can sort on any column in the result set regardless of whether it is displayed or not. A sort column can contain any type of data (that is, numbers, strings, or dates). String sorting is independent of case.


Assigning an Icon to a Result Set Value

You can assign an icon to a result set value so that each occurrence of the value is easily identifiable in a result set. The Report Browser provides a set of predefined icons for this purpose. You can also specify the position of the icon relative to the value (that is, to the left, to the right, or centered).

When you choose Icons on the Edit menu, or click the [image] button on the toolbar, the Report Browser opens the Icons dialog.

The purpose of each control in the Icons dialog is explained below:

•	Icons. Displays a list of the icons that you can assign to a result set value. You can drag an icon from this list directly onto a result set value to assign the icon to the value. Assign the blank space at the top of the list to remove an icon from a result set value.

•	Style. Specify the icon positioning option (that is, the position of an icon relative to the result set value). The options are:

•	Icon left of value

•	Icon right of value

•	Icon replaces value

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Icons enhance your view of a result set and you can incorporate them into a report view. When you assign an icon to a result set value, you can quickly identify that value in the result set.

Related Topics

  To assign an icon to a result set value

  To remove an icon from a result set value


To assign an icon to a result set value

1.	Double-click on a report to display the result set.

2.	Click the [image] button in the toolbar or choose Icons on the Edit menu to open the Icons dialog.

3.	Select the icon positioning option you want in the Style box.

4.	Drag the icon you want from the Icons list to a value in the currently displayed result set. The Report Browser assigns the icon you selected to each occurrence of the value in the result set.

Note:	To change the icon assigned to a value, drag the new icon to the value in the result set.


To remove an icon from a result set value

1.	Double-click on a report to display the result set.

2.	Click the [image] button in the toolbar or choose Icons on the Edit menu to open the Icons dialog.

3.	Drag the blank icon (the first icon in the list) to a value in the result set that contains the icon you want to remove. The Report Browser removes the icon you selected for each occurrence of the value in the result set.


Finding Items in a Result Set

The Report Browser includes a search tool that you can use to quickly find information in a result set.

When you choose Find on the Search menu, or click on the [image] button in the toolbar, the Report Browser displays the Find in Result Set dialog which provides several options for customizing your search. You can:

•	Find and mark the first row in the result set that satisfies your search conditions.

•	Find and mark all rows in the result set that satisfy your search conditions.

•	Hide all the rows in the result set that fail to satisfy your search conditions.

•	Display your result set in outline and detail form.

•	Find and mark the rows in the result set where the value in a column changes from the previous value.

Each control in the Find in Result Set dialog is explained below:

•	Column. Displays a list of the columns that you can search on. A binocular symbol [image] is displayed next to the column if there is a search expression defined for that column. To clear the search expression for a column, select the column, then click the Clear button.

•	Expression. Enter the search criteria for the selected column. Use the text below the box for guidelines on the permitted expression syntax.

•	Find First. Finds the first row in the result set that satisfies the search expressions you have defined for result set columns and places the match symbol ( [image]) next to it in the result set. You can use the Find Next button [image] in the toolbar to find subsequent matches in the result set. This option is useful when the result set is large and a complete search on all of the rows takes some time.

•	Find All. Finds all the rows that satisfy the search expressions you have defined for the result set columns and places the match symbol ( [image]) next to them in the result set. When you click the Find All button, the Find dialog closes automatically.

•	Clear. Click this button to clear all settings in the dialog before specifying new search conditions.

•	Cancel. Closes the dialog and cancels any changes.

•	Hide Unmatched. Select this check box to hide the result set rows that fail to satisfy the search criteria. When you select this check box, the match symbol ( [image]) is not displayed in the returned result set because all rows match the search criteria.

•	Collapse/Expand. Select this check box to display the result set in outline and detail form. When you select this check box, the Report Browser hides unmatched items but gives you the option to view them. An expand symbol [image] is displayed next to each matched item. You can click the [image] symbol to see all unmatched items up to the next matched item. When a matched item is expanded, a collapse symbol [image] is displayed next to the matched item. You can click the [image] symbol to hide all the unmatched items between the matched item and the next matched item.

•	Find Value Changes. Select this check box to find the rows where the value of the selected column changes. This option is useful when searching columns that many repeating values.

Related Topics

  To find result set rows that match the specified search criteria

  To find a change of value in a result set column


To find result set rows that match the specified search criteria

1.	Double-click on a report to display the result set.

2.	Click the [image] button on the toolbar or choose Find on the Search menu to open the Find In Result Set dialog.

3.	Select the column on which you want to search.

4.	Type the search criteria in the Expression box. Use the text below the box as a guideline for the permitted expression syntax. After you specify an expression, ERwin places a binocular symbol [image] next to the column in the list.

5.	Optionally, repeat Steps 2 and 3 to define search expressions on other columns.

6.	Choose one or more of the following options:

•	To find the first result set row that satisfies all of the search expressions you have defined for selected columns, click the Find First button. The Report Browser displays a match symbol ( [image]) next to the first row where the column values match the search expressions.

•	To find the next result set row that satisfies the search expressions defined for the selected columns, click the [image] button on the toolbar.

•	To find and mark all result set rows that satisfy the search expressions defined for the selected columns, click the Find All button in the Find In Result Set dialog. The Report Browser displays a match symbol ( [image]) next to all rows where the column values match the search expressions.

Note:	To clear the search expression for a column, first select the column, then click the Clear button.


To find a change of value in a result set column

1.	Double-click on a report to display the result set.

2.	Click the [image] button on the toolbar or choose Find on the Search menu to open the Find In Result Set dialog.

3.	Select the column in which you want to find a value change.

4.	Select the Find Value Changes check box.

5.	Click the Find First button. The Report Browser displays a match symbol ( [image]) next to the first row where the selected column value changes.

6.	Choose one or more of the following options:

•	To find the next change of value in the selected column, click the [image] button on the toolbar.

•	To find and mark all rows where the selected column value changes, click the Find All button in the Find In Result Set dialog. The Report Browser displays a match symbol ( [image]) next all rows where the column value changes.


Hiding Rows That Do Not Match the Search Criteria

When you specify a search criteria in the Find In Result Set dialog, you can choose to hide the rows that do not match the search criteria. In addition, you can use the expand and collapse feature to produce a search result set in which you can expand (view) or collapse (hide) the rows that do not satisfy the search criteria.

Related Topics

  To hide result set rows that do not match search criteria


To hide result set rows that do not match search criteria

1.	Double-click on a report to display the result set.

2.	Click the [image] button on the toolbar or choose Find on the Search menu to open the Find In Result Set dialog.

3.	Select the column on which you want to search.

4.	Type the search criteria in the Expression box. Use the text below the box as a guideline for the permitted expression syntax. A check is displayed in the box next to the column in the list.

5.	Optionally, repeat Steps 2 and 3 to define search expressions on other columns that you want your search to satisfy.

6.	Select the Hide Unmatched check box.

7.	Optionally, select the Expand/Collapse check box.

8.	Click the Find All button. The Report Browser displays only rows that match the search criteria. If you selected the Expand/Collapse check box in Step 7, a [image] symbol is displayed next to each matched value. Click the [image] symbol to view the unmatched values.


Saving a Report View

After you make formatting changes to your result set, you can save them as a named report view, which functions exactly like a predefined report. The report view ( [image]) appears in the tree control under the report ( [image]) or the editable report ( [image]) on which it is defined, and you can generate it by double-clicking it, just like a normal report. Report views are also displayed in the Most-Recently Used list in the toolbar and in the Available Reports display for a result set row. You can even drop a result set row on an eligible report view to run the report.

A report view includes all result set format changes, including column ordering, heading changes, sorting options, icon assignments, and search criteria. You can define several report views for the same report. You can even switch between report views for the same result set without re-generating the report, simply by dragging the result set icon and dropping it on the report view you want to see.

When you choose Save View on the File menu, or click the Save View button [image] on the toolbar, the Report Browser opens the Save View dialog. You can also click the Save button in the Report Options dialog to open the Save View dialog.

The purpose of each control in the Save View dialog is explained below:

•	View Name. Enter a name for the report view. You can also select an existing report view name if you want to overwrite that view with the current view settings.

•	Parameters. If the result set for which you are defining the report view was generated by a report requiring parameters, the Report Browser gives you the option of saving the parameter values as part of the report view. Select the check box next to each parameter for which you want to include a value as part of the report view.

For example, if the result set was generated by an Entities report for the Human Resources Model diagram, then this list contains one item, the object identifier for the Human Resources Model diagram.

•	If you select the check box next to this item, the identifier becomes part of the report view, which means that the next time you generate the report view, it produces a list of entities in the Human Resources Model diagram.

•	If you do not select the check box next to this item, the identifier does not become part of the report view, which means that you can generate it for any diagram and it appears in the Available Reports dialog for any result set row that identifies a diagram.

•	Description. Enter a description of the report view. The description you enter appears in the box below the tree control when you select the report view in the tree control.

•	OK. Closes the dialog and saves your changes.

•	Cancel. Closes the dialog and cancels any changes.

Related Topics

  To save a report view


To save a report view

1.	Double-click on a report to display the result set.

2.	Customize the report format. More>

3.	Click the [image] button in the toolbar or choose Save View on the File menu to open the Save Report View dialog.

4.	Click in the Report View Name box and type a name for the report view.

5.	Optionally, if you want to include one or more parameters as part of the report view, select the check box next to each parameter you want to include.

6.	Optionally, enter a description of the report view in the Description text box.

7.	Click OK. The Report Browser saves the report view with the name you specify and adds a report view icon ( [image]) to the tree control under the report from which the view was generated.


Printing a Result Set

The Report Browser provides many different options for printing a result set in the format you want. When you choose Print on the Report Browser File menu, the Report Browser opens the Print Result Set dialog.

Using the Print Result Set dialog, you can:

•	Set options for printing the result set.

•	Specify the page setup for the result set printout .

•	Preview the result set before printing.

•	Export the result set.

Related Topics

  To print a result set

  To set print and page layout options


To print a result set

•	Choose any one of the following:

•	Click the Print button on the Report Browser toolbar to open the Print Result Set dialog. More>>

•	Right-click on a result set in the tree control and choose Print result set ‘<result set name>’ from the shortcut menu


To set print and page layout options

1.	Click the Print button on the Report Browser toolbar to open the Print Result Set dialog.

2.	Select the print options you want in the Print range, Print what, Copies, Presentation, and On line overflow group boxes. More>>

3.	Optionally, click the Page Setup button and select the page setup options you want. More>>

4.	Optionally, click the Print Preview button to preview the result set printout before printing. More>>

5.	Optionally, click the Printer button to open the standard Windows Print Setup dialog.

6.	Click OK.


Setting Options When Printing a Result Set

When you choose Print on the Report Browser File menu, the Report Browser opens the Print Result Set dialog. Using the options in the Print Result Set dialog, you can select the page range, the area of the result set to be printed, the number of copies, the output format, and the page width overflow options.

The purpose of each control in the Print range group box is explained below:

•	All. Print all pages in the result set.

•	Page(s). Print the range of pages specified in the From and To boxes.

•	From. Type the starting page of a page range.

•	To. Type the ending page of a page range.

The purpose of each control in the Print what group box is explained below:

•	Selection. Print only the selected area of the result set.

•	Entire result set. Print the complete result set.

The purpose of each control in the Copies group box is explained below:

•	Copies. Type the number of copies you want to print.

•	Collate. Select this check box to collate pages.

The purpose of each control in the Presentation group box is explained below:

•	Tabular. Print the result set in a format similar to how the result set is displayed on screen. Click here for an example.

•	Master-detail. Print the result set in a format that uses a combination of headings and tables. The Report Browser uses the relationship between model components to determine which values are printed in headings and which values are printed in tables. Click here for an example.

•	Indented. Print the result set as an indented list. The Report Browser uses the relationship between model components to determine which values are indented and which values are not indented. Click here for an example.

•	One Item per line. Print a result set with one item on each line. Click here for an example.

The purpose of each control in the On line overflow group box is explained below:

•	Span. Print a result set where the width of the result set spans horizontally across pages when necessary.

•	Wrap. Print a result set where columns that do not fit in the width of the page are wrapped to the next available space in the result set output.

•	Repeat. Type the number of columns that are repeated when result set columns are wrapped.

Related Topics

  Specifying the Page Setup for a Result Set Printout


Specifying the Page Setup for a Result Set Printout

When you click the Page Setup button on the Print Result Set dialog, the Report Browser displays the Page Setup dialog that contains three tabs:

•	Layout. Use this tab to set the style of the grid lines, the size of each margin, the page orientation, and the position of the image area on the printed page.

•	Fonts. Use this tab to set the font, size, and features of the various text elements such as column headings, in the result set printout.

•	Text. Use this tab to change the default headers, footers, page numbers, and titles.

The Page Setup dialog also contains the following controls:

•	Print. Print the result set to the currently selected printer.

•	Print Preview. Preview the result set printout before printing.

•	Restore. Restore the default page setup settings.

•	OK. Close the dialog and save page setup changes.

•	Cancel. Close the dialog without saving page setup changes.


Setting the Layout Characteristics for a Result Set Printout

You use the Layout tab in the Page Setup dialog to set the style of the grid lines, the size of each margin, the page orientation, and the position of the image area on the printed page. A graphic in the lower right corner of the tab provides a visual indication of the page layout and highlights in red text the currently selected page setup parameter.

The purpose of each control in the Line styles group box is explained below:

•	Line. Select a line type. The line types you can select are: Border, Row dividers, and Column dividers. Once you select a line type, you can choose one of the following characteristics to apply to the line type: Omit, Light, Normal, or Heavy.

The purpose of each control in the Margins group box is explained below:

•	Top. Type or select a value for the top margin.

•	Bottom. Type or select a value for bottom margin.

•	Left. Type or select a value for the left margin.

•	Right. Type or select a value for the right margin.

The purpose of each control in the Orientation group box is explained below:

•	Portrait. Print the result set in portrait format.

•	Landscape. Print the result set in landscape format.

The purpose of each control in the Position on Page group box is explained below:

•	Left. Print the result set image area on the left side of the image area on the printed page.

•	Center. Print the result set image area in the center of the image area on the printed page.

•	Right. Print the result set image area on the right side of the image area on the printed page.

Related Topics

  Specifying the Page Setup for a Result Set Printout


Setting the Font Characteristics for a Result Set Printout

You can use fonts to enhance the appearance of a result set and make it easier to view and understand. You can apply different fonts to the different text elements that appear in a result set printout. You can use the Fonts tab of the Page Setup dialog to set the font, size, and features of the various text elements.

The purpose of each control on the Fonts tab is explained below:

•	Element. Select the text element to which you want to apply font characteristics. The available element types are: Title, Column headings, Headers and footers, and Body text.

•	Font. Select the type font, such as Arial.

•	Size. Type or select the font size in points, such as 8 point.

•	Features. Select one or more of the following features: Bold, Italic, or Underline to apply to the currently selected text element.

•	Sample. Displays sample text that reflects the currently selected font characteristics.

Related Topics

  Specifying the Page Setup for a Result Set Printout


Changing Default Headers, Footers, Page Numbers, and Titles

You can customize the appearance of a result set printout by changing the default headers, footers, page numbers, and titles that appear on the printed result sets. You can use the Text tab of the Page Setup dialog to change the default text elements.

The purpose of each control on the Text tab is explained below:

•	Element. Select the text element to which you want to apply font characteristics. The available text elements are: Title, Header, Footer, and Page number.

•	Position. Select the alignment (Left, Center, Right, Inside, or Outside) of the selected text element. When you select the page number element, you can also click either the Top or Bottom button to position the page number at the top or bottom of each page.

•	Template. Accept the default macro, select any combination of the default macros, or type the text you want to appear as the selected text element. The list of default macros includes: Page Number, Current time, Current Date, Title, Title with Details, Report Folder, First Row on Page, Last Row on Page, Object, and User.

•	Sample. Displays a sample of the selected text elemet with any defined macros expanded to show real values.

Related Topics

  Specifying the Page Setup for a Result Set Printout


Previewing a Result Set

You can preview each page of a result set before you print it using the Print Preview feature in the Report Browser. This feature is particularly helpful if you make changes to the layout, headers and footers, page numbers, a title, or the page margins; and you want to see how the changes will appear in the printed result set.

When you click the Print Preview button [image] on the Report Browser toolbar, choose Print Preview from the Report Browser File menu, or click the Print Preview button in the Print Result Set or Page Setup dialogs, the Report Browser opens the Print Preview dialog.

The purpose of each control in the Print Preview dialog is explained below:

•	Print. Print the result set as it is shown in the preview area.

•	Next Page. Display the next page of the result set in the preview area.

•	Prev Page. Display the previous page of the result set in the preview area.

•	One Page/Two Page. Toggle the print preview display to show either a single page or two pages of the result set you are printing.

•	Zoom in. Increase the magnification of the view of the result set in the preview area.

•	Zoom out. Decrease the magnification of the view of the result set in the preview area.

•	Close. Close the Print Preview dialog.

Related Topics

  To preview a result set before printing


To preview a result set before printing

•	Choose any one of the following:

•	Click the Preview button on the Report Browser toolbar.

•	Choose Print Preview on the Report Browser File menu.

•	Click the Print Preview button in the Print Result Set or Page Setup dialog.

•	Right-click on a result set in the tree control and choose Preview result set ‘<result set name>’ on the shortcut menu.


Exporting a Result Set

You can export a result set generated by the Report Browser to a comma-separated values (CSV) or HyperText Markup Language (HTML) file. You can also export a result set to RPTwin, the Logic Works reporting tool or another application that supports Dynamic Data Exchange (DDE), such as Microsoft Word.

When you choose Export on the Report Browser File menu or click the Export button in the Print Result Set dialog, the Report Browser opens the Export from Report Browser dialog.

The purpose of each control in the Export from Report Browser dialog is explained below:

•	Export format. Select the format or destination of the output as follows:

•	CSV. Export the result set in comma-separated values (CSV) format. The resulting output can be imported by most spreadsheet applications including Microsoft Excel.

•	HTML. Export the result set in HTML format. The resulting output can be displayed in any Web browser or imported into another application such as Microsoft Word or Excel.

•	DDE. Export the result set to another application that supports Dynamic Data Exchange (DDE) such as Microsoft Word.

•	RPTwin. Export the result set to RPTwin, the Logic Works reporting tool.

•	Export. Export the result set.

•	Cancel. Cancel the export operation.

The purpose of each control in the Presentation group box is explained below:

•	Tabular. Export the result set in a format similar to the format in which the result set is displayed on screen. Click here for an example.

•	Master-detail. Export the result set in a format that uses a combination of headings and tables. The Report Browser uses the relationships between model components to determine which values are printed in headings and which values are printed in tables. Click here for an example.

•	Indented. Export the result set as an indented list. The Report Browser uses the relationships between model components to determine how the values are indented. Click here for an example.

•	One Item per line. Export a result set with one item on each line. Click here for an example.

The purpose of each control in the Export to group box is explained below:

•	File. Export the result set to a file. This option is not available if you select DDE as the export format.

•	Clipboard. Export the result set to the Clipboard. This option is not available if you select DDE or RPTwin as the export format.

Related Topics

  To export a result set


To export a result set

1.	Choose Print from the File menu. The Report Browser opens the Print Result Set dialog.

2.	Click the Export button. The Report Browser opens the Export from Report Browser dialog.

3.	Choose one of the following options in the Export format list:

•	To generate a comma-separated values (CSV) file, choose CSV.

•	To generate an HTML file, choose HTML.

•	To output the result set to RPTwin, choose RPTwin.

•	To output the result set to another DDE application, choose DDE.

4.	Choose one of the following options in the Presentation group box:

•	To generate a result set in a tabular format similar to the manner in which the result set is displayed on screen, click Tabular. Click here for an example.

•	To generate a result set as a mix of headings and subtables, click Master-detail. Click here for an example.

•	To generate a result set as a mix of headings and lists, click Indented. Click here for an example.

•	To generate a result set as a list with one item on each line, click Item per line. Click here for an example.

5.	Choose one of the following options in the Export to group box:

•	To export the result set to a file, click File.

•	To export the result set to the Clipboard, click Clipboard.

6.	Click Export.

Note:	If you select RPTwin as the output format and RPTwin is not available on your computer, the first time you try to export a result set to RPTwin, ERwin displays a message indicating that it cannot find RPTwin. Contact your Logic Works representative to obtain a copy of RPTwin.


Exiting the Report Browser

You can exit the Report Browser using any of the standard Windows techniques for closing applications.

The Report Browser saves any report views ( [image]) you create for future sessions, However, it does not automatically save report result sets ( [image]). If you want to save your result sets for the next session, you must explicitly move them to a new folder.

Related Topics

  To exit the Report Browser


To exit the Report Browser

•	Choose Exit on the Report Browser File menu.

Note:	The Report Browser does not automatically save report result sets ( [image]). If you want to save your result sets for the next session, you must explicitly move them to a new folder.


Using the Report Browser with ModelMart

The Report Browser is a powerful tool for browsing and reporting on ModelMart information. When a ModelMart client such as, ERwin or BPwin, has a connection to ModelMart, the tree control in the Report Browser shows two nodes for ModelMart information, General and ModelMart <Name>. The General node node contains predefined reports for generic information in the ModelMart, for example, information about all the ModelMart diagrams in the ModelMart, such as diagram ID, diagram name, and so on. The ModelMart <Name> node contains reports on specific ModelMart objects, for example, the videostore..movies.er1 diagram.

You can also open the Report Browser from the ModelMart Change Control Manager, the ModelMart Library Manager, and the ModelMart Security Manager. When you open the Report Browser from one of these managers, the Report Browser tree control shows a folder with reports specific to the ModelMart manager from which the Report Browser was opened.

After you run a report and generate a result set, you can customize the content and appearance of the result set and create and save you own custom report views. You can use the Report Browser search features to find information in the result set. You can also specify a search expression, which can include strings, numbers, or dates, for one or more columns so that the ModelMart Report Browser finds only the result set rows that satisfy all the search expressions. You can also find a change of value in a column and hide result sets rows that do not match the search.

Typically, you can use a result set row from one report to generate another report. When you select a row in the currently displayed result set, there is a feature for indicating which reports in the tree control are available to the selected result set row. Using this feature, you can create a thread of linked reports where each report provides more detailed information.

You can use the Report Browser to find objects in the ModelMart. For example, you can find which library or diagram contains a specific object simply by dropping a row corresponding to an object in a report onto the ModelMart node in the tree. You can also open a ModelMart diagram or subject area by dragging its icon from the tree control into the ModelMart window.

Related Topics

  ModelMart Nodes in the Report Browser Tree Control

  Summary of Tree Control Symbols for ModelMart Objects


ModelMart Nodes in the Report Browser Tree Control

The tree control in the Report Browser shows the reports and result sets as an indented outline based on their logical hierarchical relationship. The caption bar above the tree control shows the currently selected root node of the tree.

When a ModelMart client such as ERwin or BPwin has a connection to ModelMart and you open the ModelMart Browser, the tree control shows two nodes in addition to the ERwin Reports node as follows:

•	General. This is the base node for a folder hierarchy of predefined ModelMart reports, customized report views, and result sets. When you click the expand symbol [image] next to the General folder, it expands to show subfolders of predefined reports organized by category.

•	ModelMart <NAME>. This is the base node for the ModelMart object hierarchy extended to show the reports, customized report views, and the result sets associated with specific ModelMart objects. You open an object by clicking the expand symbol [image] next to the object. When you open the ModelMart, it expands to show the libraries in the ModelMart. When you open a library, it expands to show the diagrams in the library. When you open a diagram, it expands to show the subject areas and snapshots associated with that diagram. The reports applicable to each object (that is, Library, Diagram, Subject Area, and Snapshot) are shown below the object in the tree.

The Report Browser displays one of the following folders when opened from the corresponding ModelMart manager dialog:

•	Script Reports. This folder is displayed when you click the Report Browser button in the ModelMart Change Control Manager toolbar. The reports in this folder generate result sets that contain information about about model changes and conflicts.

•	Library Reports. This folder is displayed when you click the Report button in the ModelMart Library Manager dialog. The report in this folder generates a result set that contains details about the objects in each ModelMart library.

•	Security Reports. This folder is displayed when you click the Report button in the ModelMart Security Manager dialog. The report in this folder generates a result set that contains details about the security profile assigned to each ModelMart user and the permissions granted in each security profile.

Related Topics

  To view ModelMart reports by category

  To view reports by ModelMart object

  Summary of Tree Control Symbols for ModelMart Objects


To view ModelMart reports by category

•	Choose Reports by Category on the View menu.

OR

•	Click on the General folder, then click the Make Selected folder the Root button [image].


To view reports by ModelMart object

•	Choose Reports by ModelMart Object on the View menu.

OR

•	Click on the ModelMart <NAME> folder, then click the Make Selected folder the Root button [image].


Summary of Tree Control Symbols for ModelMart Objects
Tree Control Symbols for ModelMart Objects

In addition to the standard symbols for Report Folder ( [image]), Report ( [image]), Result Set ( [image]), and Report View ( [image]), the tree control uses the symbols in the following table to identify ModelMart objects.

Summary of Tree Control Symbols for ModelMart Objects

Symbol	Meaning
	ModelMart
	ModelMart Library
	ModelMart Diagram
	ModelMart Subject Area
	Snapshots


Generating a ModelMart Report

You can use the Report Browser to retrieve information from the ModelMart in a number of ways:

•	You can generate one of the pre-defined ModelMart reports ( [image]) supplied with the Report Browser. A predefined ModelMart report is a SQL query that returns the requested result set from the ModelMart. For example, the Diagrams report (in the General folder) is a predefined report that returns information about each diagram in the ModelMart such as, diagram ID, diagram name, number of entities, number of attributes, and so on.

•	In a result set, you can use a row that identifies a ModelMart object to generate a report available for objects of that class. For example, if a result set row identifies a diagram, all of the reports in the Diagrams folder are available to the user for that row. For many reports, a result set row identifies several different objects which means that there are many different reports available to that row.

In the Report Browser, you can drag a result set row onto any one of the available reports to generate the selected report. You can use this feature to create a chain of related reports where each report provides more detailed information about the objects in reports higher up in the hierarchy. For example, you can drag a row from the Diagrams report (which shows diagram information) and drop it on the Entity report (in the Diagrams Reports folder) to generate a new report that shows entity information (that is, entity name, corresponding table name, entity definition) for each entity in the diagram.

When the Report Browser generates a result set ( [image]) for a ModelMart report, it assigns a name according to the following convention:

<report type> <report name> (<time> <number of rows>)

where,

•	<report type> is the type of the report that generated the result set.

•	<report name> is the name of the report that generated the result set.

•	<time> is the time the result set was generated.

•	<number of rows> is the number of rows in the result set.

While the Report Browser is generating a report, it displays the ModelMart Query dialog. If you click Cancel while a report is being generated, the Report Browser does not display a result set (that is, incomplete result sets ( [image]) are never displayed).

If a report does not generate a result set, the Report Browser displays a message indicating that the requested report doesn’t contain any rows. Click OK to continue.

When you drop a result set row onto a report icon, or double-click on a report in the Available Reports dialog, the Report Browser uses parameter values from the selected row to generate the report. Typically, a parameter value is a ModelMart object identifier, but it can also be the name of an object or even a string that allows wildcard operators. Some of the predefined reports require that you enter one or more parameters before the report is generated.

When you choose a report that requires parameter values, the Report Browser displays the ModelMart Query Parameter dialog that prompts you to enter the parameter values. You must enter the value of the parameter you are interested in before the Report Browser can generate the report.

You can also click the Display browser history button [image] to open the Result Set History dialog to display a list of all the result sets generated in the current ERwin and ModelMart sessions in chronological order. You can then display or delete one or more of the result sets. See To display a history of generated result sets  for more information.

When you double-click on a result set in the History dialog, the result set is displayed in the Result Set area, but the icon for that result set is also highlighted in the tree control. This is an easy way to locate the result set icon that corresponds to a result set.

After you generate a result set for a report, you can then use the Report Browser’s extensive range of features to further customize the content and change the appearance of the result set. See Customizing a Result Set View  for more information.

Note:	A result set for a ModelMart report exists only during the ModelMart session. If you want to keep a result set for the next ModelMart session, you must create a folder and move the result set to it. See To save a result set for the next ModelMart session  for more information.

Related Topics

  To generate a ModelMart report


To generate a ModelMart report

1.	Open the report folder ( [image]) in the tree control that contains the report ( [image]) you want, then double-click on the report.

OR

Choose the report from the list box on the toolbar, then click the Execute report button [image] if the report is one that you run frequently.

OR

Right-click on a report ( [image]) and choose Execute Report <report name> from the shortcut menu.

2.	If the report requires parameter values, the Report Browser opens the ModelMart Query Parameter dialog. Enter the parameter value and click OK. The Report Browser displays the result set generated by the report in the Result Set area and adds an icon for the result set ( [image]) to the tree under the report icon.

Note:	In Step 1 above, you can click on the report, then click the Execute report button [image] in the toolbar to generate the report. You can also click on the report and choose the Execute Report option on the File menu.


Using a Result Set Row to Generate a Report

Once you generate a ModelMart report, you can generally use a row from the result set ( [image]) to generate another report. The Report Browser provides two ways of doing this.

•	Simply drag the result set row onto the report you want in the tree control if you know which reports are available for a result set row.

•	Click on the result set row, then click the Find Report for Selected Row button [image] if you do not know which reports are available to a result set row. The Report Browser displays the Available Reports dialog which is a tree control containing the reports available to the selected row. Double-click on the report you want in the Available Reports dialog to generate the new report.

When you create a new report with either of the two methods described above, the Report Browser automatically creates a link between the source report and the newly created report.

When the newly created report is displayed, you can click the  Display prior linked result set button [image] to display the source report again.

Related Topics

  To generate a report using a result set row

  To generate a report from the reports available list

  To display a previously linked result set


To generate a report using a result set row

1.	Double-click on a previously generated result set ( [image]) in the tree control to display the result set in the Result Set area.

2.	Drag a row from the Result Set area and drop it on one of the appropriate reports ( [image]) in the tree control. The Report Browser displays the result set for the report in the Result Set area and adds an icon for the newly generated result set to the tree control.

Note:	By clicking the Display prior linked result set button [image], you can easily return to the source result set since the Report Browser maintains a link between the source result set and the newly generated result set.


To generate a report from the reports available list

1.	Double-click on a previously generated result set ( [image]) in the tree control. The Report Browser displays the result set in the Result Set area.

2.	Click on a row in the result set.

3.	Click the Find reports for selected row button [image] on the toolbar to open the Available Reports dialog. The tree control in this dialog displays only the reports appropriate to the selected result set row.

4.	Double-click on any report to generate that report for the currently selected result set row.

Note:	By clicking the Display prior linked result set button [image], you can easily return to the source result set since the Report Browser maintains a link between the source result set and the newly generated result set.


To display a previously linked result set

1.	Double-click on the result set that has a link to a previously generated result set.

2.	Click the Display prior linked result set button [image]. The Report Browser displays the source result set from which the selected result set was generated.


Saving the Result Set for a ModelMart Report

If you want the result sets for a ModelMart report to be available in the next ModelMart session, you must explicitly save the result set in a folder you have created. See To create a new report folder  for more information. After you create the new folder, you can drag and drop a result set into the new folder.

You can also save a result set to a file. See Exporting a Result Set for more information.

Related Topics

  To save a result set for the next ModelMart session


To save a result set for the next ModelMart session

1.	Locate the report folder where you want to store the result set or create a new report folder. See To create a new report folder for more information.

2.	Drag the result set icon ( [image]) for the report you want to save into the newly created folder. The Report Browser saves your result set for the next ModelMart session.

Note:	You can create your own hierarchy of folders. For example, you can create a folder for each modeling project and create subfolders under the project folders organized by modeler or by time, for example, a week’s worth of daily change reports.


Creating a ModelMart Library Manager Report

When you click the Report button in the ModelMart Library Manager dialog, the Report Browser opens. The tree control in the Report Browser displays a Library Reports folder that contains one predefined Library Report. When you double-click on the Library Report icon in the tree control, the Report Browser generates a result set that provides information about the objects in each ModelMart library.

After you generate the report, you can use the Report Browser features to customize the appearance of a result set, find one or more specific items in the result set, print the result set, or export the result set. See Customizing a Result Set View .

Note:	You can also generate a report on changes you have made using the ModelMart Security Manager. See Creating a ModelMart Change Control Manager Report .

Related Topics

  To create a ModelMart Library Manager Report

  ModelMart Library Manager Report Content

  Sample ModelMart Library Manager Report


To create a ModelMart Library Manager Report

1.	In the ModelMart Library Manager dialog, click the Report button. The Report Browser opens.

2.	In the Report Browser tree control, open the Library Reports folder.

3.	Double-click on the Library Report icon. The Report Browser generates a result set that contains information about the objects in each ModelMart library.

Related Topics

  Sample ModelMart Library Manager Report


ModelMart Library Manager Report Content

The standard Library Report generates a result set with the following information:

•	Object Class. The class of the object as it appears in the ModelMart Library Manager dialog. For example, library, diagram, subject area.

•	Object Name. The name of the object as it appears in the ModelMart Library Manager dialog. For example, videostore, movie1, movie1;1.

•	Owner Class. The object class of the owner of the library, diagram, or subject area as it appears in the ModelMart Library Manager dialog. For example, ModelMart, library, diagram.

•	Owner Name. The name of the owner of the library, diagram, subject area, etc. as it appears in the ModelMart Library Manager dialog. For example, videostore, movies.

•	Object Description. The user-defined description for the library, diagram, subject area, snapshot, archive, or version. For example, 9/2/99 Test Version.

•	Updated By. The name of the ModelMart user who last modified the library, diagram, or subject area and saved changes to ModelMart (for example, JSMITH).

•	Created By. The name of the ModelMart user who created the library, diagram, or subject area and saved it to ModelMart (for example, JSMITH).

•	Updated. The date that the library, diagram, or subject area was last saved to ModelMart (for example, Jan 15 1999 12:00 AM).

•	Created. The date that the library, diagram, or subject area was created and saved to ModelMart (for example, Jan 15 1999 12:00 AM).


Sample ModelMart Library Manager Report

The report shown below is an example of a ModelMart Library Manager report.

Related Topics

  ModelMart Library Manager Report Content


ModelMart Editable Reports and User Defined Property Reports

Using the Report Browser, you can make changes directly into the ModelMart, without loading any diagrams. You can modify many object properties, such as entity definitions and relationship verb phrases. You can even extend the ModelMart by adding new properties of your own.

You can use the Report Browser to enter and edit information in the ModelMart using the following editable reports:

•	User-Defined Property Report.  Use to define new properties for any object class in an ERwin diagram.

•	Property Reports. Use to assign a value to individual object properties, including user-defined properties, and report on these properties from the Report Browser. Property Reports include:

•	Diagram Object Property Reports. Use to view and edit properties of diagram objects, such as entities and attributes.

•	Library Object Property Reports. Use to view and edit properties of library objects, such as domains.

•	Definition and Relationship Label Reports. Use to quickly enter and edit entity definitions, attribute definitions, or relationship parent-child verb phrase.

The changes you make to your ModelMart using the Report Browser are governed by exactly the same security and synchronization constraints that govern changes made via the ERwin diagram editor. Like ERwin, the Report Browser enforces both user profile permissions and diagram locking.


Working with ModelMart Editable Reports

ModelMart Editable reports are listed in the General report option list in the Report Browser tree control.

You can use editable report to enter and edit object property information. For example, with the Edit Attribute Definitions report, you can edit the definitions for all attributes in any diagram in the ModelMart.

To run a report, double-click on the report name and select or enter the parameters for the report when prompted.

If the report returns one or more rows to the Report Browser, the resulting rows are displayed in the Result Set Area of the Report Browser. Like other reports, the Report Browser saves the result set of an editable report as a named report in the report hierarchy. Each new report is listed in the Report Browser under the editable report option that you used to generate it.

Note:	You can also run an editable report from the Available Reports dialog. To view the available report, including editable reports, for a ModelMart object, select the object's row in a report, then click the Available Reports button.


Working with the Create User-Defined Properties Report

When you double-click on the Create User-Defined Properties report in the Report Browser report tree, the Report Browser queries the ModelMart and displays all object classes and their editable properties in the Result Set Area.

The property list includes properties available in ERwin, such as definition or parent-child verb phrase, as well as any existing user-defined properties.

To edit the result set for the Create User-Defined Properties report, scroll to the end of the report and click in the empty row.

When you click on the Class column, the Report Browser opens a list box that provides a complete list of all object classes in an ERwin model. Choose the object class that you want to associate with a user-defined property, then click on the Property column to enter a new name for the user-defined property.

When you are finished editing, click the Commit changes button [image] to save your changes.

You can use other reports in the Report Browser to assign values to a user-defined property for one or more objects in the associated class. For example, if you create the “Location of Target Server” property and assign it to the Diagram object class, you can then use the Edit Library Object Properties by Property report to view all diagrams in the library and assign a value to the new user-defined property.


To add a user-defined property to the ModelMart

1.	Click the expand button [image] next to the General report folder.

2.	Click the expand button [image] next to the Editable Reports folder.

3.	Double-click on the Create User-Defined Properties report.

4.	Select the blank row at the end of the report.

5.	Click on the Class field to select the object class to which you want to assign a user-defined property.

6.	Click on the Property field and type the name of the new user-defined property.

7.	Click the Commit changes [image] to save your changes.

8.	Click OK.


Working with Property Reports

You can use the Property reports in the Report Browser to edit many different object properties and save the changes to the ModelMart. These reports can be conceptually grouped as follows:

•	Diagram Object Property Reports. Use to view and edit properties of diagram objects, such as entities and attributes. The report is filtered to show properties by class or a single property for all classes. Diagram Object Property Reports include:

•	Edit Diagram Object Properties by Class

•	Edit Diagram Object Property by Property

•	Library Object Property Reports. Use to view and edit properties of library objects, such as domains. The report is filtered to show all editable properties for each object class or a single property for all classes. Library Object Property Reports include:

•	Edit Library Object Properties by Class

•	Edit Library Object Property by Property

•	Definition and Relationship Label Reports. Use to quickly enter and edit entity definitions, attribute definitions, or relationship parent-child verb phrases. Unlike the other Property reports, these reports are filtered to show only a single property for the specified object class. Definition and Relationship Label Reports include:

•	Edit Entity Definitions

•	Edit Attribute Definitions

•	Edit Relationship Labels

These reports are discussed fully later in this chapter.


Editing Object Properties in the Report Browser

Each Diagram Object Property report and Library Object Property report includes two or more columns. Use the Report Browser to edit the values that appear in the Value, Definition, or Phrase columns.

To help you discover which values are editable, the cursor automatically displays as a pencil when you pass it over an editable field in a selected row.

When you click on an editable field with the pencil cursor, the Report Browser opens an edit box for that field. You can use the standard keyboard editing keys to enter, modify, or delete the existing value.

Click the Commit changes button [image] in the Report Browser toolbar or click on the report outside of the edit box to save your changes to the ModelMart. You are then prompted to confirm or cancel the changes to the ModelMart.

While you are editing a field in the Report Browser, you can click the ESC (Escape) key to cancel any changes you have made to the selected row.

To edit larger blocks of text, you may want to open the Report Browser's editing window. To open the editing window, click with the pencil cursor to open the edit box, then press the CTRL+ENTER key combination to open a larger editing window.

When you have completed your changes, click the OK button to close the editing window and save your changes to the ModelMart.

Note:	The Report Browser saves the changes to the ModelMart after each change. If the Library that contains the affected ModelMart diagram has Auto Archive option enabled, an archive of the diagram is also saved after each change.


Working with Diagram Object Property Reports

Diagram Object Property reports include:

•	Edit Diagram Object Properties by Class. Use to select the diagram and class of diagram object that you want to edit. The report displays all objects of the selected class that appear in the diagram. You can edit all available property values for each object. The example below shows a report on all entity properties in the MOVIES model.

•	Edit Diagram Object Property by Property. Use to select the diagram and property that you want to edit. The report displays all classes of objects in the diagram. You can edit the specified property value for each object. The example below shows a report on the Definition property for all object classes in the MOVIES model.

To run a Diagram Object Property report in the Report Browser, you must provide the diagram ID number when prompted, or drag a diagram name from a different report onto the report name. You can use the resulting report to edit the property values that appear in the Value column.

In addition to standard property values, you can also edit all user-defined property values for each object in the diagram. The specific user-defined property you want to edit must have already been added to the ModelMart using the Create User-Defined Properties report.


To edit diagram object properties in the Report Browser

1.	Click the expand button [image] next to the General report folder.

2.	Click the expand button [image] next to the Global Report folder.

3.	Double-click on the Diagrams report. Using this report, you can select the diagram you want to use to create an editable report.

4.	Click the expand button [image] next to the Editable Reports folder.

5.	Select the diagram you want edit in the Result Set Area of the Report Browser, then drag and drop it on a Diagram Object Property report. If you dropped the diagram name on the:

•	Edit Diagram Object Properties by Class report, the Report Browser prompts you to select an object class.

•	Edit Diagram Object Property by Property report, the Report Browser prompts you to select a property.

6.	After you select an object class or property, click OK. The Report Browser displays the new editable report in the Result Set Area.

7.	Select the property value you want to edit, then click on the value field with the pencil cursor.

8.	Enter or edit the selected property value using the standard keyboard editing keys.

9.	Click the Commit changes button [image] to close the edit box and save your changes.

10.	Click OK to save your changes to the ModelMart.


Working with Library Object Property Reports

Library Object Property reports include:

•	Edit Library Object Properties by Class. Use to select the library and class of library object that you want to edit. The report displays all objects of the selected class that appear in the library. You can edit all available property values for each object. The example below shows a report on all diagram properties in the Videostore library.

•	Edit Library Object Property by Property. Use to select the library and property that you want to edit. The report displays all classes of library objects. You can edit the specified property value for each object. The example below shows a report on the Definition property for all object classes in the Videostore library.

To run a Library Object Property report in the Report Browser, you must provide the library ID number when prompted or drag a library name from a different report onto the report name. You can use the resulting report to edit the property values that appear in the Value column.

In addition to standard property values, you can also edit all user-defined property values for each object in the library. The specific user-defined property you want to edit must have already been added to the ModelMart using the Create User-Defined Properties report.


To edit library object properties in the Report Browser

1.	Click the expand button [image] next to the General report folder.

2.	Click the expand button [image] next to the Global Report folder.

3.	Double-click on the Libraries report. Using this report, you can select the library you want to use to create an editable report.

4.	Click the expand button [image] next to the Editable Reports folder.

5.	Select the diagram you want to edit in the Result Set Area of the Report Browser, then drag and drop it on a Library Object Property report. If you dropped the library name on the:

•	Edit Library Object Properties by Class report, the Report Browser prompts you to select an object class.

•	Edit Library Object Property by Property report, the Report Browser prompts you to select a property.

6.	After you select an object class or property, click OK. The Report Browser displays the new editable report in the Result Set Area.

7.	Select the property value you want to edit, then click on the value field with the pencil cursor.

8.	Enter or edit the selected property value using the standard keyboard editing keys.

9.	Click the Commit changes button [image] to close the edit box and save your changes.

10.	Click OK to save your changes to the ModelMart.


To assign user-defined properties in the Report Browser

1.	Click the expand button [image] next to the General Report folder.

2.	Click the expand button [image] next to the Global Report folder.

3.	Choose one of the following actions:

•	To locate the library that contains the object you want to edit, double-click on the Libraries report.

•	To locate the diagram that contains the object you want to edit, double-click on the Diagrams report.

4.	Click the expand button [image] next to the Editable Reports folder.

5.	Choose one of the following options:

•	To edit user-defined properties for library objects, select the library you want to edit in the Result Set Area of the Report Browser, then drag and drop it on the Edit Library Object Property by Property report.

•	To edit user-defined properties for diagram objects, select the diagram you want to edit in the Result Set Area of the Report Browser, then drag and drop it on the Edit Diagram Object Property by Property report.

6.	When the Report Browser prompts you to select a property, select a user-defined property name in the drop-down list.

7.	Click OK. The Report Browser displays the new editable report in the Result Set Area.

8.	Select the value you want to edit, then click on the value field with the pencil cursor.

9.	Enter or edit the value for the user-defined property using the standard keyboard editing keys.

10.	Click the Commit changes button [image] to close the edit box and save your changes.

11.	Click OK to save your changes to the ModelMart.


Working with Definition and Relationship Label Reports

Definition and Relationship Label reports are special types of diagram property reports that preselect the object class and property displayed in the report. To run a Definition or Relationship Label report in the Report Browser, you must provide the diagram ID number when prompted or drag a diagram name onto the report name.

Definition and Relationship Label Reports include:

•	Edit Attribute Definitions. The resulting report displays the entity name, attribute name, and attribute definition for the selected diagram. You can edit attribute definitions in this report.

•	Edit Entity Definitions. The resulting report displays the entity name and entity definition for the selected diagram. You can edit entity definitions in this report.

•	Edit Relationship Labels. The resulting report displays the parent entity name, relationship parent-child verb phrase, and child entity name for each relationship in the selected diagram. You can edit the verb phrase in this report.


To edit definitions or relationship verb phrases in the Report Browser

1.	Click the expand button [image] next to the General report folder.

2.	Click the expand button [image] next to the Global Report folder.

3.	Double-click on the Diagrams report. Using this report, you can select the diagram you want to use to create an editable report.

4.	Select the diagram you want to edit.

5.	Choose one of the following options:

•	To edit entity definitions, drag and drop the diagram name on the Edit Entity Definitions report.

•	To edit attribute definitions, drag and drop the diagram name on the Edit Attribute Definitions report.

•	To edit relationship parent-child verb phrases, drag and drop the diagram name on the Edit Relationship Label report.

6.	After the Report Browser displays the new result set, click on any row in the result set to select it.

7.	Click on the Definition field or the Phrase field for the selected row. The Report Browser opens a scrollable edit box for the selected field, as shown below.

8.	Use the standard editing keys to modify the value.

9.	Click the Commit changes button [image] to close the edit box and save your changes.

10.	Click OK to save the change in the ModelMart.

Note:	The Report Browser saves the changes to the ModelMart after each change. If the Library that contains the affected ModelMart diagram has Auto Archive option enabled, an archive of the diagram is also saved after each change.


Summary of Editable Classes and Properties

The following table lists the editable properties for each object in a model.

Class	Property
Attribute	Definition Note
Column	--
Diagram	Description
Domain	Definition
Entity	Definition Icon Note Owner Query Sample
Index	File Name For Expression Key Expression
Library	Auto-Archive Description
Physical Object	Definition Display Format Type Edit Style Type Template Code Trigger Code Trigger New Trigger Old Trigger Type
Relationship	Parent-child Verb Phrase Definition
Report	Report Report List Report Options Report Type
Stored Display	Author Definition Print Info
Subject Area	Author Definition
Table	Location Owner
Text Block	Contents
Note:	You can also associate an object class with one or more user-defined properties. User-defined properties are named and associated with an object class in the Create User-Defined Properties report. You can assign a value to a user-defined property in the Diagram Object Property reports or Library Object Property reports.


Summary of ModleMart Editable Reports

The following table lists the editable reports in the Report Browser, the user-supplied parameters required to run the report query, valid class or property parameters, the editable fields in the result set, and a description of the contents of the result set.

Report Name	Parameter Type(s)	Valid Parameters	Editable Column(s)	Description
Create User-Defined Properties	None (reports on the entire ModelMart).	N/A	Class and Property	You can create new user-defined properties for any class of ModelMart objects.
Edit Attribute Definitions	Diagram ID.	N/A	Definition	You can enter or update the attribute definitions in the selected ModelMart model.
Edit Diagram Object Properties by Class	Object Class and Diagram ID.	Entity Domain Relationship Attribute Table Column Attribute Group Index Index Member User Text Block Physical Object Subject Area Stored Display Report Synonym	Value	Diagram property report filtered on object class. You can enter or edit property values for each object in the class and diagram selected.
Edit Diagram Object Property by Property	Property Name and Diagram ID.		Value	Diagram property report filtered on property. You can enter or edit property values for all objects associated with the selected property.
Edit Entity Definitions	Diagram ID.	N/A	Definition	You can enter or update the entity definitions in the selected ModelMart model.
Edit Library Object Properties by Class	Object Class and Library ID.	Domain Physical Object Diagram	Value	Library property report filtered on object class. You can enter or edit property values for each object in the class and diagram selected.
Edit Library Object Property by Property	Property Name and Library ID.		Value	Library property report filtered on property. You can enter or edit property values for all objects associated with the selected property.
Edit Relationship Labels	Diagram ID.	N/A	Phrase	You can enter or update the physical relationship name for each relationship in the selected diagram.


Creating an ODBC Data Source for the ModelMart Database

Before you can create a ModelMart on an INFORMIX server, you must use the 32-bit ODBC Manager to create an ODBC data source to access the INFORMIX database on which you want to install ModelMart.

Users that intend to use a ModelMart client, such as ERwin or BPwin, must also create an ODBC data source to access the INFORMIX database.

Note:	The name of the ODBC data source is the name you enter in the DBMS Connection box in the ModelMart Connection Manager dialog when you log on to ModelMart.

Related Topics

  To create an ODBC data source


To create an ODBC data source

1.	Choose Start, Settings, and Control Panel to open the Control Panel window.

2.	Double-click the 32bit ODBC icon to open the 32-bit ODBC Manager.

3.	Click the Add button to open the Add Data Source dialog.

4.	Select INFORMIX-CLI 2.5 (32-bit) from the Installed ODBC Drivers list.

5.	Click OK. The ODBC INFORMIX Driver Setup dialog opens.

6.	Enter the following information:

•	Data Source Name. The name of the data source, for example, informix911.

•	Description. A description of the data source.

•	Database Name. The name of the database that contains the ModelMart, for example, mmart. This is an important step since you cannot select the database in the ModelMart Connection dialog.

7.	Click the Advanced button to open the ODBC INFORMIX Advanced Driver Setup dialog. The information in this dialog reflects the settings specified using the configuration utility for Inet. Click the Help button to get information about the controls in this dialog.

8.	Click Close to return to the ODBC INFORMIX Driver Setup dialog.

9.	Click OK to return to the Data Sources dialog. The new data source is displayed in the User Data Sources (Drivers) list.

10.	Click Close.

Note:	The data source name that you specify in this procedure is the name the user must type in the DBMS Connection box in the ModelMart Connection Manager dialog to connect to ModelMart.


			eri_tre_seq_get_id
			eri_upe_sa_rel_ves
			erw_att_group_dete
			erw_attr_cade_dete
			erw_bitmap_depeies
			erw_column_create
			erw_diagram_create
			erw_dim_get_lod_as
			erw_domain_depeies
			erw_entity_create
			erw_font_create
			erw_glal_doin_crte
			erw_index_delete
			erw_library_create
			erw_link_pant_chld
			erw_message_log
			erw_obct_fere_upte
			erw_object_create
			erw_object_find
			erw_object_open
			erw_obt_phs_prp_cr
			erw_obt_prf_asn_ue
			erw_obt_tet_prp_ue
			erw_permion_update
			erw_phal_obj_delte
			erw_phs_prp_tae_ue
			erw_query_delete
			erw_repoitory_open
			erw_report_create
			erw_rery_acve_scpt
			erw_session_clenup
			erw_start_script
			erw_sted_diay_dete
			erw_suct_area_enll
			erw_sync_users
			erw_sys_info
			erw_tale_cade_dete
			erw_trace_purge
			erw_udpdef_setname


Managing ModelMart Libraries and Diagrams

ERwin stores a group of diagrams that share a set of common objects (called library objects) in a ModelMart library. The shared library-level objects include:

Domains Edit Styles Display Formats	Validation Rules Table Spaces Rollback Segments	Stored Procedure Templates Pre- and Post- Script Templates Trigger Templates
When you choose ModelMart Library Manager on the ModelMart menu, ERwin opens the ModelMart Library Manager dialog and you can create, rename, delete, or set the archiving option for a ModelMart library.

The ModelMart Directory list provides a hierarchical view of all the libraries and diagrams in the ModelMart. To expand the list so that you can view the diagrams in a library, double-click on the library name or click on the plus sign [image] to the left of the library name. To collapse the list, double-click on the library name or click on the minus sign [image].

To create a new library, click the ModelMart icon at the top of the ModelMart Directory list. Then type the name for the new library in the Name box and click the Create button. The following options are also available:

•	Auto Archive. Select this check box if you want to automatically generate an archive of a diagram each time it is saved to the library. ERwin inserts the new library name in the ModelMart Directory list which is sorted alphabetically, and names beginning with a capital letter are shown before names that do not begin with a capital letter.

•	Enable UD Support. Select this check box if you want Universal Directory to be able read all the properties of the objects in the slected ModelMart library. If you do not check this box, Universal Directory can read only the names of the objects in the ModelMart library.

To update a library, that is, change the library name, change an option, or update a library description, select the library in the ModelMart Directory list. Make the changes you want, then click the Update button. ERwin updates the library information.

Note:	You cannot cancel the Auto Archive option for a library that already contains snapshots or archives of diagrams. ERwin informs you that you must delete all snapshots and archives of diagrams before you can turn off the Auto Archive option.

To delete a library, select the library in the ModelMart Directory list and click the Delete button. When ERwin prompts you to confirm the deletion, click Yes. ERwin deletes the library and all related diagrams from the ModelMart and updates the ModelMart Directory list.

Note:	Although you can delete a ModelMart library, you cannot independently delete a library-level object, such as a domain, since multiple diagrams may reference the domain definition. See Updating Library Objects  for more information.

To see information about a library, including the library description and information about the users currently working on diagrams in the library, click on the library, then click the Detailed >> button. ERwin expands the ModelMart Library Manager to show details about the selected library.

If you want to preserve a diagram before you delete the library in which it is stored, you can save the diagram as an .er1 file or use Save As on the ModelMart menu to save the diagram to a different library. See Saving a ModelMart Diagram as an ER1 File  and Saving a ModelMart Diagram under Another Name  for more information.

Related Topics

  To create a new ModelMart library

  To specify automatic diagram archiving for an existing library

  To cancel automatic diagram archiving for an existing library

  To enable Universal Directory to read ModelMart object properties

  To rename a ModelMart library

  To delete a ModelMart library

  Updating Library Objects

  Renaming and Deleting ModelMart Diagrams


To create a new ModelMart library

1.	Click the [image] button on the ModelMart toolbar or choose ModelMart Library Manager on the ModelMart menu.

2.	Click on the ModelMart name at the top of the ModelMart Directory list.

3.	Type the name you want to assign to the new library in the Name box.

4.	Select the Auto Archive check box if you want the ModelMart to create an archive of a diagram each time it is saved to the library.

5.	Click the Create button. ERwin prompts you to confirm that you want to create the library. Click Yes. ERwin creates the library and inserts the new library in the ModelMart Directory list.


To specify automatic diagram archiving for an existing library

1.	Click the Manage ModelMart Libraries [image] button on the ModelMart toolbar or choose ModelMart Library Manager on the ModelMart menu.

2.	Click on the library for which you want to set the Auto Archiving option in the list.

3.	Select the Auto Archive check box.

4.	Click the Update button. ERwin enables the auto archiving option for the selected library.


To cancel automatic diagram archiving for an existing library

1.	Click the Manage ModelMart Libraries [image] button on the ModelMart toolbar or choose ModelMart Library Manager on the ModelMart menu.

2.	Click on the library for which you want to reset the Auto Archiving option in the list.

3.	Make sure that the library does not contain any snapshots or archives of diagrams.

4.	Clear the Auto Archive check box.

5.	Click the Update button. ERwin prompts you to update the selected library. Click OK. ERwin disables the auto archiving option for the selected library.

Note:	You cannot cancel the Auto Archive option for a library that already contains snapshots or archives of diagrams. ERwin informs you that you must delete all snapshots and archives of diagrams before you can turn off the Auto Archive option.


To enable Universal Directory to read ModelMart object properties

1.	Click the Manage ModelMart Libraries [image] button on the ModelMart toolbar or choose ModelMart Library Manager on the ModelMart menu to open the ModelMart Library Manager dialog.

2.	Click on the library you want Universal Directory to access.

3.	Select the Enable UD Support check box.

4.	Click the Update button. Universal Directory now has access to all object properties in the selected ModelMart library.

Note:	Select the Enable UD Support option only for ModelMart libraries that you want Universal Directory to access. Selecting this option for a ModelMart library may reduce performance when saving objects to that ModelMart library.


To rename a ModelMart library

1.	Click the Manage ModelMart Libraries [image] button on the ModelMart toolbar or choose ModelMart Library Manager on the ModelMart menu to open the ModelMart Library Manager dialog.

2.	Click on the library that you want to rename in the ModelMart Directory list.

3.	Type the new library name in the Name box.

4.	Click the Update button. ERwin updates the ModelMart Directory list to show the new library name.

Note:	Any library marked locked ( [image]) or unlocked ( [image]) is currently in use and cannot be renamed.


To delete a ModelMart library

1.	Click the Manage ModelMart Libraries [image] button on the ModelMart toolbar or choose ModelMart Library Manager on the ModelMart menu.

2.	Click on the library that you want to delete in the ModelMart Directory list.

3.	Click the Delete button. ERwin prompts you to confirm that you want to delete the library.

4.	Click Yes. ERwin deletes the library and updates the ModelMart Directory list.

Note:	When you delete a library, ERwin also deletes all of the diagrams in the ModelMart that belong to that library. To preserve a diagram before you delete the library in which it is stored, you can save the diagram as an .er1 file or save the diagram in a different library. See  Saving a ModelMart Diagram as an ER1 File  and Saving a ModelMart Diagram under Another Name  information.

Any library marked locked ( [image]) or unlocked ( [image]) is currently in use and cannot be deleted.

Although you can delete a ModelMart library, you cannot independently delete a library-level object, such as a domain, since multiple diagrams may reference the domain definition. See Updating Library Objects  for more information.


Updating Library Objects

You can create, update, and delete library objects using the appropriate ERwin editor while working on a ModelMart diagram. For example, you can add a new table validation rule using the Table Property Editor or modify a domain datatype using the Domain Editor.

Because the definition of a library-level object can be shared by objects in other diagrams, library-level objects cannot be independently deleted like normal diagram objects. Although you can delete a library-level object, such as a domain, from a diagram, the deletion does not affect other diagrams (the domain definition is not deleted from the library; it is only deleted in the diagram in which you performed the deletion).

Before you save any changes back to the ModelMart master version, you can review and cancel any or all of your modifications. If you make changes to library objects, ERwin displays these changes for review before it displays other non-library object changes. When you save, ERwin automatically applies library object changes to every diagram stored in that library. See Reviewing Changes When Saving a Diagram to the ModelMart  for more information.

In order to save changes to library objects back to ModelMart, you must have Update Library permission. If you do not have permission to save library object changes to ModelMart, you can save the diagram as an .er1 file to preserve your changes to the diagram and library objects. Later, another user who has Update Library permission can use the .er1 file to save changes back to ModelMart. See Saving a ModelMart Diagram as an .ER1 File  for more information.

Also, see Using ModelMart Security Profiles  for more information on setting user security profiles for library objects.

Note:	Use caution when you save a change that involves a library object. ERwin automatically applies these changes to all diagrams in the same library, which may seriously affect the work of other users.


Renaming and Deleting ModelMart Diagrams

You can also use the ModelMart Library Manager to rename or delete a ModelMart diagram.

To rename a ModelMart diagram, select the diagram in the ModelMart Directory list. ERwin automatically inserts the diagram name in the Name box. Use the appropriate edit keys (for example, BACKSPACE or DELETE) to modify the name, then click the Update button. ERwin renames the diagram and updates the ModelMart Directory list.

To delete a ModelMart diagram, select the diagram in the ModelMart Directory list and click the Delete button. ERwin prompts you to confirm that you want to delete the diagram. When you click Yes, ERwin automatically deletes the diagram from the ModelMart and updates the ModelMart Directory list.

Click on the plus sign [image] next to a library to view the diagrams in that library. Click on the diagram you want, then click the Detailed button, ERwin expands the dialog to show the other users that have a copy of the diagram and the lock mode of each copy.

Note:	Any diagram marked locked ( [image]) or unlocked ( [image]) is currently in use and cannot be renamed or deleted.

Related Topics

  To rename a ModelMart diagram

  To delete a ModelMart diagram


To rename a ModelMart diagram

1.	Click the Manage ModelMart Libraries [image] button on the ModelMart toolbar or choose ModelMart Library Manager on the ModelMart menu.

2.	Click on the ModelMart diagram that you want to rename in the list box.

3.	Use the appropriate edit keys (for example, BACKSPACE or DELETE) to modify the ModelMart diagram name in the Name box.

4.	Click the Update button. ERwin renames the ModelMart diagram and updates the ModelMart Directory list to show the new ModelMart diagram name.

Note:	Any diagram marked locked ( [image]) or unlocked ( [image]) is currently in use and cannot be renamed.


To delete a ModelMart diagram

1.	Click the [image] button on the ModelMart toolbar or choose ModelMart Library Manager on the ModelMart menu.

2.	Click on the ModelMart diagram that you want to delete in the ModelMart Directory list.

3.	Click the Delete button. ERwin prompts you to confirm that you want to delete the ModelMart diagram.

4.	Click Yes. ERwin deletes the ModelMart diagram and updates the ModelMart Directory list.

Note:	Any diagram marked locked ( [image]) or unlocked ( [image]) is currently in use and cannot be deleted.


Using ERwin Domains

An ERwin domain is an independent model object that you can use to quickly assign properties to an attribute or column. You can define both logical and physical domains in the Domain Dictionary Editor.

After you create a domain, ERwin adds it to a pool of independent attributes and independent columns. To help you reuse domains throughout your model, ERwin displays all logical domains in the Independent Attribute Browser and all physical domains in the Independent Column Browser. You then can drag any member from the browser and drop it into an entity or table to quickly create an owned attribute or column. The owned attribute or column inherits all of its properties from the domain on which the independent attribute or independent column is based. By using this drag-and-drop method, you can quickly populate all the entities and tables in your diagram.

Once you create an owned attribute or column, you can change its name using on-diagram editing and you can modify other properties using the Attribute and Column editors.

You can also quickly make changes to multiple attributes and columns. When you change a domain property in the Domain Dictionary Editor, ERwin automatically changes all the owned attributes or columns that are based on the domain that you changed.

If you are saving your ERwin models to ModelMart so that others can share the information, the domains you create can also be shared by all the models in the same ModelMart library.

Related Topics:

  Using Domains in Physical and Logical Models

  Domain Inheritance and Overrides

  Using Domains to Speed Modeling

  Independent Attributes and Independent Columns

  Using the Domain Dictionary Editor


Using Domains in Physical and Logical Models

Unlike other objects that are associated with either the physical or logical data model, a domain can be defined once and used in both the physical and logical data model. During the data modeling process, this feature can save significant time for both the data modeler who designs the logical model and the Database Administrator (DBA) who develops the physical data model. The logical data modeler can assign a domain to attributes in the logical model without regard to the domain’s physical column properties. After a domain is assigned to logical attributes, the physical model automatically includes column properties that are based on the domain assigned in the logical model.

To help you reuse domains throughout your model, ERwin adds all domains to a pool of independent attributes and independent columns. See Independent Attributes and Independent Columns for more information.

Related Topics

  Using ERwin Domains

  Domain Inheritance and Overrides

  Using Domains in a Logical Model

  Using Domains in a Physical Model

  Using the Domain Dictionary Editor


Using Domains to Speed Modeling

Using domains is a good way to speed up the database design process and make your data model easy to maintain. You can assign domains to attributes to enforce business decisions on datatype, and, if additional physical model characteristics are assigned to that domain, to speed the creation of a corresponding physical model.

Instead of assigning constraints to each column individually, you can create an ERwin domain and use it to set multiple properties for a column in one step. If you subsequently need to change a column property, rather than changing the property setting for each column, you can simply change the domain and all the associated columns are updated automatically.

For example, if your data model contains several different United States phone number columns (e.g., home_phone_area_code, business_phone_area_code, etc.), you can create a domain named “AREA CODE” for which the datatype is defined as SMALLINT. In addition, you can attach a list of valid AREA CODES to the domain in a validation rule (201, 202, 203, 204, etc.) and assign the local area code as the default value (609). Finally, you can assign a display format that inserts parentheses around the area code. When you assign the AREA CODE domain to a column that stores telephone area code information in your database, it automatically inherits the complete set of inheritable domain properties defined in the Domain Dictionary Editor.

You can also use independent attributes and independent columns and a drag and drop method to speed the modeling process. See Independent Attributes and Independent Columns for more information.

Related Topics:

  Using ERwin Domains

  Using Domains in a Logical Model

  Using Domains in a Physical Model

  Using the Domain Dictionary Editor


Using Domains in a Logical Model

An ERwin domain includes both logical and physical properties. When you work in the logical model, you work with just the logical properties of the domain: logical name, icon, definition, note, and logical user-defined property value. You can define these properties in the logical edit mode of the Domain Dictionary Editor. You can assign domains to attributes to enforce business decisions on datatype, and, if additional physical model characteristics are assigned to that domain, to speed the creation of a corresponding physical model.

ERwin adds all domains defined in the logical edit mode to the Independent Attribute Browser, from which you can then drag and drop an independent attribute from the browser into an entity to create a new attribute. The new attribute inherits all of its properties from the domain corresponding to the independent attribute. You can also assign a logical domain to an existing attribute in the Attribute Editor. The attribute inherits all of its properties, except its name, from the domain. You can then change any properties in the Attribute Editor.

ERwin is shipped with five predefined domains that are available in the logical model:

•	The [image] <unknown> domain is the root domain in the logical domain hierarchy. ERwin automatically assigns the <unknown> domain to all attributes when they are created.

•	The [image] String, [image] Number, [image] Datetime, and [image] Blob domains are children of the <unknown> domain. You can assign a domain to an attribute in the logical model to define a logical datatype for that attribute.

You can change the domain assignment for attributes at any point during a modeling session. You can also create new domains that more clearly define the properties you want to assign to an attribute – or its corresponding column in the physical model. For example, if you want to indicate that an attribute represents money, you could create a Money domain and assign it to the attribute.

Every standard and user-defined domain is also available in the physical model, and can be used to define physical datatype and additional column properties, such as null option, display format, validation rule, or default value. See Using Domains in Physical and Logical Models for more information.

Related Topics

  Using the Domain Dictionary Editor

  Domain Inheritance and Overrides

  Inheritable and Non-Inheritable Domain Properties

  Independent Attributes and Independent Columns

  To assign a domain to an attribute


Using Domains in a Physical Model

An ERwin domain includes both logical and physical properties. When you work in the physical model, a domain can include any or all of the properties that you can assign to an individual column, including physical name, comment, datatype, null option, default value, validation rule, and physical user-defined properties. For servers that provide native application development tools, you can also include server-side column display properties such as the column label. If you are using ERwin with PowerBuilder or Visual Basic, a domain can also include client-oriented column properties, such as PowerBuilder display formats or Visual Basic edit styles. Also, when you select DM (Dimensional Modeling) notation for your physical model, you can specify data warehouse sources for a domain.

ERwin is shipped with five predefined domains that are available in every model.

•	The [image] <default> domain is the root domain in the physical hierarchy. ERwin automatically assigns the <default> domain to all columns that have not been assigned a true domain. Properties defined by the domain include the default datatype and null option selected for the target server.

•	The [image] String, [image] Number, [image] Datetime, and [image] Blob domains are children of the <default> domain. You can assign a domain to a column in the physical model to define a datatype for that column. Each of these child domains represents a single logical datatype in the logical model.

In the physical model, ERwin automatically assigns the datatype for String, Number, Datetime, and Blob based on the default datatypes set for the target server selected. You can override the default datatype and any of the other properties (except names and parent domains) for these domains in the Domain Dictionary Editor. See Choosing a Target Database and Setting ERwin Defaults for more information about setting default datatypes.

Related Topics

  Using the Domain Dictionary Editor

  Using Domains in Physical and Logical Models

  Domain Inheritance and Overrides

  Inheritable and Non-Inheritable Domain Properties

  Independent Attributes and Independent Columns

  Implementing User Datatype Support Using Domains

  To assign a domain to a column


Domain Inheritance and Overrides

In addition to modifying and using the standard domains supplied with ERwin, you can also create new domains that work in exactly the same way.

ERwin is shipped with five predefined domains. To create a new domain in the Domain Dictionary Editor, open the New Domain dialog and select an existing domain as the parent of the new domain in the Domain Parent list. By default, all the parent domain’s inheritable properties migrate to the child domain. To override any of the child’s properties you can select the child domain from the Domain list and edit the properties using the Domain Dictionary Editor.

All of the physical domains available in the Domain Dictionary Editor are also available in the Independent Column Browser. The independent columns found in the browser inherit all their properties from their parent domain. When you drag an independent column into a table, ERwin creates a new column in that table. The new column inherits all of its properties from the independent column. Once you create a column in a table, you can use on-diagram editing to change its name and use the Column Editor to change other properties.

The non-inheritable domain properties, such as domain name and domain comment, never migrate to the independent column or newly created column. See Inheritable and Non-Inheritable Domain Properties for more information.

When you create a new domain, ERwin adds the domain name to the Domain list and indents it below its parent domain to clarify the domain hierarchy. Both the Address domain and the Person-Name domains descended from the String domain in the example below. If you create a new Business-Address domain using the Address domain as its parent, the Domain list would look like the figure below:

Related Topics

  Using ERwin Domains

  Inheritable and Non-Inheritable Domain Properties

  Using Domains in a Logical Model

  Using Domains in a Physical Model

  Using the Domain Dictionary Editor


Inheritable Domain Properties

Inheritable properties migrate from a domain to attributes and columns based on the domain or to children domains. See Domain Properties for a list of inheritable properties.


Non-inheritable Domain Properties

Non-inheritable properties do not migrate from a domain to attributes and columns based on the domain or to children domains. These properties are specific to the domain only. See Domain Properties for a list of non-inheritable properties.


Inheritable and Non-Inheritable Domain Properties

In ERwin, domains have non-inheritable and inheritable properties. Non-inheritable properties never migrate to other ERwin objects. Inheritable properties migrate to child domains and to the attributes and columns associated with the domain. The figure below illustrates how domain properties are inherited through an independent attribute or independent column to an owned attribute or column. See Domain Properties for a list of specific properties.

Related Topics:

  Domain Inheritance and Overrides

  Domain Properties

  Using the Domain Dictionary Editor

  Independent Attributes and Independent Columns


Domain Properties

Each domain in ERwin has both logical and physical properties. Some of these properties are inheritable and migrate to child domains and to the attributes and columns associated with the domain. Other properties are non-inheritable and apply only to the domain. Non-inheritable properties never migrate.

The following table lists the inheritable and non-inheritable domain properties by their labels in the Domain Dictionary Editor.

	Inheritable Property	Non-Inheritable Property
Logical	Logical Name (New Domain dialog)	Domain Name
Properties	Icon Inherited by Attribute	Domain Icon
	Definition Inherited by Attribute	Domain Definition
	Note Inherited by Attribute	Domain Note
	UDP Inherited by Attribute	Domain UDP
Physical	Physical Name (New Domain dialog)	Domain Name
Properties	User-Defined Datatype (check box)	N/A
	All database specific properties, including datatype, average column width, null option, validation, and default values	N/A
	Comment Inherited by Column	Domain Comment
	UDP Inherited by Column	Domain UDP
	Data Source and Transform Comment	N/A
	All client server specific properties including display format, valid values, labels, and comment	N/A
Related Topics:

  Using the Domain Dictionary Editor

  Inheritable and Non-Inheritable Domain Properties

  Domain Inheritance and Overrides


Independent Attributes and Independent Columns

After you create a domain, ERwin adds it to a pool of independent attributes and independent columns. To help you reuse domains throughout your model, ERwin displays all logical domains in the Independent Attribute Browser and all physical domains in the Independent Column Browser. You can drag any member from the browser and drop it into an entity or table to quickly create an owned attribute or column.

For example, to create a CUSTOMER entity with three attributes, customer number, social security number, and phone number, you can reuse the Independent Attribute Number. To do so, drag and drop Number into the key area of the CUSTOMER entity and use on-diagram editing to rename the new attribute customer number. Then drag and drop Number again, but place it in the non-key area and rename it social security number. Repeat these same steps for phone number.

When you switch from the logical to the physical model, the name in the title bar and the browser contents change dynamically. Use CTRL+B to display or hide the browser.

Note:	ERwin does not enforce the unique name rules for attribute and column names inherited from independent attributes and independent columns.

Related Topics:

  Using the Independent Attribute Browser

  Using the Independent Column Browser

  Using the Domain Dictionary Editor


Using the Independent Attribute Browser

The Independent Attribute Browser contains a list of reusable independent attributes that you can place in any entity in your model. Independent attributes are defined in the Domain Dictionary Editor as logical domains. You can drag any independent attribute from the Independent Attribute Browser into an entity to create an owned attribute, which inherits its properties from the domain from which it was created.

Choose Independent Attribute Browser on the Window menu to display or hide the Independent Attribute Browser. You can also type CTRL+B to display or hide the browser.

The purpose of each control in the Independent Attribute Browser is explained below:

•	Alphabetically. Sorts the independent attributes in alphabetical order.

•	Hierarchically. Sorts the independent attributes in hierarchical order.

•	Independent Attribute List. Displays the logical domain name. You can click on an independent attribute and drag it into an entity to create a new attribute in that entity. The new attribute inherits all of its properties from the associated domain.

•	 Opens the Domain Dictionary Editor in the logical edit mode in which you can define a new logical domain. Once you close the Domain Dictionary Editor, the domain is available as an independent attribute in the Independent Attribute Browser.

Related Topics:

  Independent Attributes and Independent Columns

  To create an attribute using an independent attribute

  Using the Domain Editor in the Logical Edit Mode


Using the Independent Column Browser

The Independent Column Browser contains a list of reusable independent columns that you can place in any table in your model. Independent columns are defined in the Domain Dictionary Editor as physical domains. You can drag any independent column from the Independent Column Browser into a table to create an owned column. The owned column inherits properties from the domain it was created from.

Choose Independent Column Browser on the Windows menu to display or hide the Independent Column Browser. You can also type CTRL+B to display or hide the browser.

The purpose of each control in the Independent Column Browser is explained below:

•	Alphabetically. Sorts the independent columns in alphabetical order.

•	Hierarchically. Sorts the independent columns in hierarchical order.

•	Independent Column List. Displays the physical domain name. You can click on an independent column and drag it into a table to create a new column in that table. The new column inherits all of its properties from the associated domain.

•	 Opens the Domain Dictionary Editor in the physical edit mode in which you can define a new physical domain. Once you close the Domain Dictionary Editor, the domain is available as an independent column in the Independent Column Browser.

Related Topics:

  Independent Attributes and Independent Columns

  To create a column using an independent column

  Using the Domain Dictionary Editor in the Physical Edit Mode


Using the Domain Dictionary Editor

ERwin domains are a flexible tool for defining a set of properties and assigning them to an attribute or column. Using the Domain Dictionary Editor, you can define new domains with logical and physical properties which can be reused as independent attributes and independent columns. You can also modify the properties of any user-defined domain, as well as all properties of the five standard domains shipped with ERwin, except the domain name and domain parent. You can use the Domain Dictionary Editor to create domains

When you choose Domain Dictionary Editor on the Edit menu, ERwin opens the Domain Dictionary Editor.

The Domain Dictionary Editor displays different tabs depending on the edit mode you select:

•	Logical Edit Mode Tabs

•	Physical Edit Mode Tabs

The purpose of each control in the Domain Dictionary Editor is explained below:

•	Edit Mode. Select Logical to specify logical domain properties in the dialog tab pages or select Physical to specify physical domain properties in the dialog tab pages.

•	Alphabetically. Sorts the domains in alphabetical order.

•	Hierarchically. Sorts the domains in hierarchical order.

•	Domain. Displays a list of all domains in the model. When you select a domain in the list, ERwin displays the domain properties specified for the selected domain in the dialog tab pages. You can change the properties of multiple domains in one session without closing the Domain Dictionary Editor. Any changes you make to a domain are implemented in the model when you click OK or select a different domain name in the Domain list.

•	New. Opens the New Domain dialog and add a new domain.

•	Rename. Opens the Rename Domain dialog and edit the name of the selected domain.

•	Delete. Deletes the selected domain from the model.

•	Reset. Opens the Reset Domain Properties dialog and reset one or more domain properties to the domain’s default setting. For example, if you have changed the null option setting for a new domain from NULL (a value inherited from the parent domain) to NOT NULL, you can use the Reset Domain Properties dialog to reset the default NULL setting.

•	OK. Closes the dialog. When you close the Domain Dictionary Editor, ERwin automatically cascades any changes you made to a domain to all columns attached to that domain throughout the diagram.

•	Cancel. Closes the dialog and cancels your changes.

Related Topics

  Using ERwin Domains

  Inheritable and Non-Inheritable Domain Properties

  Using Domains in Physical and Logical Models

  Using Domains to Speed Modeling

  Independent Attributes and Independent Columns


Using the Domain Dictionary Editor in the Logical Edit Mode

When you use the Domain Dictionary Editor in the logical edit mode, you can view and modify the logical properties assigned to a domain. You can specify one set of properties for the domain itself (non-inheritable properties) and a different set of properties for attributes based on the domain (inheritable properties).

When you choose Domain Dictionary Editor on the Edit menu, ERwin opens the Domain Dictionary Editor.

See Using the Domain Dictionary Editor for a description of the controls that are common to both the logical and physical edit modes.

The Domain Dictionary Editor includes the following tabs when in the Logical edit mode:

•	General. Specify a non-inheritable parent domain and icon, and specify the name and icon inherited by attributes associated with the domain. You can also specify if the domain is Logical Only or Required.

•	Definition. Type an inheritable and non-inheritable domain definition.

•	Note. Type an inheritable and non-inheritable note.

•	UDP. Specify an inheritable and non-inheritable user-defined property value.

Related Topics

  To create a domain in the logical edit mode

  To modify a logical domain name

  To delete a logical domain

  Using the Domain Dictionary Editor in the Physical Edit Mode


Specifying a Parent Domain in the Logical Edit Mode

You can use the controls in the General tab of the Domain Dictionary Editor in logical edit mode to view or select a parent domain. Once a parent domain is selected, the inheritable properties of the parent domain are automatically inherited by the domain. These inherited properties can be overridden using the other controls in the Domain Dictionary Editor.

The purpose of each control in the General tab is explained below:

•	Domain Parent. The parent of the selected domain. To change the parent, select a different domain from the list. This is a non-inheritable property.

•	Domain Icon. The non-inheritable icon for the selected domain. To change the icon, select a different icon from the list. Each of the default domains is automatically assigned an icon:  <unknown>, [image] Blob, [image] Datetime, [image] Number, [image] String.

•	 (Domain Icon) Click to open the Icon Editor from which you can import BMP files to use in your ERwin diagram. See Using the ERwin Icon Editor for more information.

•	Name Inherited by Attribute. Type the name or ERwin macro that the attribute inherits when associated with the selected domain. The ERwin macro %AttDomain automatically migrates the logical domain name to the attribute name.

•	Icon Inherited by Attribute. The icon that the attribute inherits when associated with the selected domain. To change the icon, select a different icon from the list.

•	 (Icon Inherited by Attribute) Click to open the Icon Editor from which you can import BMP files to use in your ERwin diagram. See Using the ERwin Icon Editor for more information.

•	Logical Only. Select this check box if you want the selected domain to appear in the logical model only. Clear this check box if you want the selected domain to be available in both the logical and physical model.

•	Required. Select this check box if you want attributes associated with this domain to be a required field in a data entry application. This option corresponds to the NOT NULL option in a physical model.

Hint: 	An asterisk next to any property indicates that ERwin derives the property value from domain inheritance or a macro.

Related Topics

  Using the Domain Dictionary Editor in the Logical Edit Mode

  To specify a domain parent in the logical model

  Domain Inheritance and Overrides


Specifying a Domain Definition

You can use the controls in the Definition tab of the Domain Dictionary Editor in the logical edit mode to view and update the domain definition.

The purpose of each control in the Definition tab is explained below:

•	Domain Definition. Type or edit the definition for the selected domain. This definition is non-inheritable.

•	Definition Inherited by Attribute. Type or edit the definition that the attribute inherits when associated with the selected domain. In the Comment tab of the Domain Dictionary Editor in the physical edit mode, you can choose to use the %AttDef macro to match the inheritable domain comment with the inheritable domain definition.

•	 Cuts, copies, and pastes text using the Clipboard.

•	 Opens the ERwin Text Editor.

Hint: 	An asterisk next to any property indicates that ERwin derives the property value from domain inheritance or a macro.

Related Topics

  Using the Domain Dictionary Editor in the Logical Edit Mode

  To specify a domain definition in the logical model


Specifying a Domain Note

You can use the controls in the Note tab of the Domain Dictionary Editor in the logical edit mode to view and update a note for a domain.

The purpose of each control in the Note tab is explained below:

•	Domain Note. Type or edit the note for the selected domain. This note is non-inheritable.

•	Note Inherited by Attribute. Type or edit the note that the attribute inherits when associated with the selected domain.

•	 Cuts, copies, and pastes text using the Clipboard.

•	 Opens the ERwin Text Editor.

Hint: 	An asterisk next to any property indicates that ERwin derives the property value from domain inheritance or a macro.

Related Topics

  Using the Domain Dictionary Editor in the Logical Edit Mode

  To specify a domain note in the logical model


Specifying Attribute Domain UDP Values

After you create UDPs for domains and attributes, in the UDP Editor, you can easily specify logical user-defined property values in the UDP tab of the Domain Dictionary Editor in the logical edit mode.

The UDP tab contains two grids, each having the same controls but specifying different domain properties as follows:

•	Domain User-Defined Properties. Specify values for non-inheritable domain user-defined properties.

•	User-Defined Properties Inherited by Attribute. Specify attribute user-defined property values that the attribute inherits when associated with the selected domain.

The purpose of the controls in the UDP tab are explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays in a ToolTip. When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can type a value or select a property value depending on the value datatype:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP for you to select the backup frequency such as “daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the UPD Editor to define Domain User-Defined Properties or Attribute User-Defined Properties.

Hint: 	An asterisk next to any property indicates that ERwin derives the property value from domain inheritance or a macro.

Related Topics

  Using the Domain Dictionary Editor in the Logical Edit Mode

  To specify attribute domain UDP values

  Creating User-Defined Properties


Using the Domain Dictionary Editor in the Physical Edit Mode

When you use the Domain Dictionary Editor in the logical edit mode, you can view and modify the logical properties assigned to a domain. You can specify one set of properties for the domain itself (non-inheritable properties) and a different set of properties for attributes based on the domain (inheritable properties). For servers that provide native application development tools, you can also include server-side and client-side column display properties such as the column display label.

When you choose Domain Dictionary Editor on the Edit menu, ERwin opens the Domain Dictionary Editor.

See Using the Domain Dictionary Editor for a description of the controls that are common to both the logical and physical edit modes.

In the Physical edit mode, the Domain Dictionary Editor includes the following tabs:

•	General. Specify a non-inheritable parent domain and the name inherited by columns associated with the domain. You can also specify if the domain is Physical Only or a user-defined datatype, if the target server supports them.

•	<Database>. Manage the inheritable datatype, null option, validation (constraint) rule, and default value for the selected domain. The name of this tab changes dynamically depending on the target server selected. For example, if you are working with a SQL Server target server, the tab reads “SQL Server”.

•	Comment. Type an inheritable and non-inheritable column comment.

•	UDP. Specify an inheritable and non-inheritable user-defined property value.

•	Data Source. Attach one or more data warehouse source columns to a domain and document the transformation made from source(s) to warehouse. These are inheritable properties.

•	Visual Basic. Specify the inheritable edit control features within the domain for Visual Basic.

•	PowerBuilder. Specify the inheritable edit control features within the domain for PowerBuilder.

ERwin displays only the first few tabs that are available. You can scroll through the available tabs using the spin control [image].

Related Topics

  To create a physical domain

  To modify a physical domain name

  To delete a physical domain

  To reset domain properties to their default values

  Using the Domain Dictionary Editor in the Logical Edit Mode


Specifying a Parent Domain in the Physical Edit Mode

You can use the controls in the General tab of the Domain Dictionary Editor in physical edit mode to view or select a parent domain. Once a parent domain is selected, the inheritable properties of the parent domain are automatically inherited by the domain. These inherited properties can be overridden using the other controls in the Domain Dictionary Editor.

The purpose of each control in the General tab is explained below:

•	Domain Parent. The parent of the selected domain. To change the parent, select a different domain from the list. This is a non-inheritable property.

•	Name Inherited by Column. Type the name or ERwin macro that the column inherits when associated with the selected domain. The ERwin macro %AttDomain automatically migrates the logical domain name to the column name.

•	Physical Only.  Select this check box if you want the selected domain to be available in the physical model only. Clear this check box if you want the selected domain to be available in both the physical and logical model.

•	User-Datatype. Select this option if you want to generate the selected domain as a user datatype. When you select this option, ERwin generates the selected domain as a user-defined datatype in the schema. If you do not select this box, ERwin uses the domain properties when it includes column information in the CREATE TABLE statement. This feature is available for DB2/2, InterBase, Rdb, SQL Anywhere, SQL Server, and SYBASE.

Hint: 	An asterisk next to any property indicates that ERwin derives the property value from domain inheritance or a macro.

Related Topics

  Using the Domain Dictionary Editor in a Physical Model

  To specify a parent domain in the physical model

  To create a domain that appears in the physical model only

  Domain Inheritance and Overrides

  Implementing User Datatype Support Using Domains


Setting Database-Specific Domain Properties

You can use the controls in the <Database> tab of the Domain Dictionary Editor to view and update database-specific information about the domain including datatype, null option, default value, or validation rule. All properties defined in the <Database> tab are inheritable.

The purpose of each control in the <Database> tab is explained below:

•	<Database> Datatype. Displays the datatype of the selected domain. Select a datatype from the list to change the datatype for the selected domain. If the selected datatype requires a value for precision, scale, or both, type the value inside the datatype parentheses. For example, depending on the target server selected, you can choose the DECIMAL() datatype and specify DECIMAL(10,2).

•	Null Option. Select the options that apply. Depending on the database selected, ERwin displays one or more of the following options:

•	Not Null. Specifies the NOT NULL clause for the selected column.

•	Null. Specifies the NULL clause for the selected column.

•	Identity. Specifies an IDENTITY clause for the selected column.

•	With Null. Specifies the WITH NULL clause for the selected column.

•	Not Null with Default. Specifies the NOT NULL WITH DEFAULT clause for the selected column.

•	Average Width. Type an estimated average width for the column domain, if the option is available (not dimmed). For example, for a variable width string datatype, you can assign an average width of 20 characters as the average character width of any column that uses the domain. You can later use the Volumetrics Editor to calculate table and database size estimates based on columns that use the domain.

•	Percent NULL. Type the estimated percentage of null values used for the column domain, if the option is available (not dimmed). For example, for a variable width string datatype, you can assign an estimate of 30 to indicate that any column using the column domain will contain a null about 30 percent of the time. Use whole numbers. You can later use the Volumetrics Editor to calculate table and database size estimates based on these and other values.

•	ALLOC. Type a value in characters that defines the space you want to allocate for the column in each row. The control is only displayed when the selected datatype is VARCHAR() or VARGRAPHIC(). (AS/400 only)

•	ALLOW ZERO LENGTH. Select this check box if you want to be able to store a zero-length string in this column. Clear this check box to prohibit zero-length strings in this column. (Access only)

•	Case Sensitive. Select this check box if you want the DBMS to consider the case of the values stored in database fields for the selected column during processing. If you do not select this check box, the case of the characters in a value is ignored. For example, “table”, “TABLE”, and “Table” are treated as different values when Case Sensitive is selected; when Case Sensitive is not selected, the values are considered the same. This check box displays only when you select the CHAR() or CHARACTER() datatype (PROGRESS and Teradata only).

•	Decimals. Type the number of decimal places to display for the values in the selected column. If you do not type a number, the Decimals value is set to zero. This text box displays only when you select the DECIMAL, DECIMAL(), or DECIMAL(,) datatype (PROGRESS only).

•	For. Select the character string column subtype option (SBCS, MIXED, or BIT) from the list. This control is only displayed when the selected datatype is CHAR, CHAR(), CHARACTER, CHARACTER(), VARCHAR(), or LONG VARCHAR() (DB2/MVS and DB2/2 only).

•	IN <blobspace>. Type the name of the INFORMIX blobspace in which you want to store the current column.  If you leave the text box blank, data in the current column is stored with the rest of the table. The IN <blobspace> field displays when you select a text or byte datatype (INFORMIX only).

•	Type. Select a sub-datatype. The sub-datatype options depend on the datatype selected. This control displays only when the selected datatype is CHAR, CHAR(), CHARACTER, CHARACTER(), GRAPHIC, GRAPHIC(), VARCHAR(), or VARGRAPHIC() (AS/400 only).

•	Valid. Displays the name of the validation rule attached to the selected domain. The template code for the selected validation rule appears below this list. Select a different validation rule from this list to apply to the selected domain. You can use the Validation Rule Editor to create, modify, or delete the validation rules in the list.

•	. (Valid). Click this button to open the Validation Rule Editor.

•	Default. Displays the name of the default rule attached to the selected domain. The default value for the selected default rule appears below the Default list. Select a different default rule from this list to apply to the selected domain. You can use the Default Editor to create, modify, or delete the default rules in the list.

•	. (Default). Opens the Default Editor.

As well as these standard controls, ERwin provides additional datatype, column storage, and display property support for some servers, including Access, AS/400, PROGRESS, and Teradata databases.

Hint: 	An asterisk next to any property indicates that ERwin derives the property value from domain inheritance or a macro.

Related Topics

  Using the Domain Dictionary Editor in a Physical Model

  To change the properties assigned to a domain


Specifying a Column Comment Using a Domain

You can use the controls in the Comment tab of the Domain Dictionary Editor in the physical edit mode to view and update the domain and column comment.

The purpose of each control in the Comment tab is explained below:

•	Domain Comment. Type or edit the comment for the selected domain to describe its settings or usage. This comment is non-inheritable.

•	Comment Inherited by Column. Type or edit the comment that the column inherits when associated with the selected domain. To use the column comment entered in the Column Editor, type %AttDef in the text box.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Hint: 	An asterisk next to any property indicates that ERwin derives the property value from domain inheritance or a macro.

Related Topics

  Using the Domain Dictionary Editor in a Physical Model

  Specifying a Column Definition

  To specify a column definition using a domain

  To specify a domain definition


Specifying Column Domain UDP Values

After you create UDPs for domains and columns in the UDP Editor, you can easily specify physical user-defined property values in the UDP tab of the Domain Dictionary Editor in the physical edit mode.

The UDP tab contains two grids, each having the same controls but specifying different domain properties as follows:

•	Domain User-Defined Properties. Specify values for non-inheritable domain user-defined properties.

•	User-Defined Properties Inherited by Column. Specify column user-defined property values that the column inherits when associated with the selected domain.

The purpose of each control in the UDP tab is explained below:

•	Property. Displays the name of the user-defined property. When you point to the property name, the UDP description displays a ToolTip.

•	When you use the Command datatype for a UDP property, the box where the property name displays becomes a button that you can click to launch a file or application that you can specify in the Value text box.

•	Value. If you use a default value when you create a UDP property, the property value is automatically specified. Otherwise, you can choose to do one of the following:

•	Type the property value in the Value text box for Integer, Real Number, and Text datatypes.

•	Type a date value; or click on the spin control button [image] to change the month, day, and year; or click on the calendar button [image] to select a date on the drop-down calendar for the Date datatype.

•	Select a value from the Value list for the List datatype. For example, you can create a UDP from which you can select the backup frequency such as “Daily” from the Value list.

•	Type a system command or click the [image] button to browse for a file or executable program for the Command datatype. For example, you can type or select C:\Myfile.doc to launch the Microsoft Word document “Myfile.doc”.

•	. Click to open the physical UPD Editor to define Domain User-Defined Properties or Column User-Defined Properties.

Hint: 	An asterisk next to any property indicates that ERwin derives the property value from domain inheritance or a macro.

Related Topics

  Using the Domain Dictionary Editor in a Physical Model

  To specify column domain UDP values

  Creating User-Defined Properties


Specifying Data Warehouse Sources Using Domains

You can document data warehouse source assignments and transform information for each domain in your dimensional model in the Data Source tab of the Domain Dictionary Editor. All source documentation is inherited by columns attached to the domain. You can override any source properties on a column by column basis in the Column Editor. The Data Source tab is only available when you select DM (Dimensional Modeling) notation for your physical model.

The purpose of each control in the Data Source tab is explained below:

•	Data Sources. Lists all data warehouse sources attached to the selected domain.

•	 (Data Sources). Click this button to open the Data Warehouse Source Selector dialog.

•	Transform Comment. Type a comment describing how the source is integrated into the data warehouse.

•	. Cuts, copies, and pastes text using the Clipboard.

•	. Opens the ERwin Text Editor.

Hint: 	An asterisk next to any property indicates that ERwin derives the property value from domain inheritance or a macro.

Related Topics:

  Using the Domain Dictionary Editor in the Physical Edit Mode

  To specify a data warehouse source for a domain

  To remove a data warehouse source from a domain

  Using the Data Warehouse Source Selector

  Using the Data Warehouse Source Editor


To create an attribute using an independent attribute

1.	Choose Independent Attribute Browser on the Window menu if the browser is not displayed.

2.	Select the [image] or [image] tool.

3.	Click and drag an independent attribute into an entity to create an owned attribute which inherits its name and all other logical and physical properties from the corresponding domain.


To create a column using an independent column

1.	Choose Independent Column Browser on the Window menu if the browser is not displayed.

2.	Select the [image] or [image] tool.

3.	Click and drag an independent column into a table to create an owned column which inherits its name and all other logical and physical properties from the corresponding domain.


To create a domain in the logical edit mode

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Logical in the Edit Mode list.

3.	Click New.

4.	Select a parent domain in the Domain Parent list (String, Number, Blob, Datetime, or a user-defined domain name).

5.	Type a domain in the Logical Name text box.

6.	If you do not change the physical name, it is automatically derived from the logical name. Optionally, click in the Physical Name text box and edit the physical domain name.

7.	Click OK.

8.	Choose one or more of the following options:

•	To assign a different parent domain, click the General tab then select a different parent domain in the Domain Parent list.

•	To type a definition or note, click the Definition or Note tab and type the information.

9.	Click OK.


To modify a logical domain name

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Logical in the Edit Mode list.

3.	Select the domain with the name you want to modify in the Domain list.

4.	Click the Rename button.

5.	Edit the name in the Logical text box.

6.	Click OK to close the Rename Domain dialog.

7.	Click OK.


To delete a logical domain

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Logical in the Edit Mode list.

3.	Select the domain you want to delete in the Domain list.

4.	Click the Delete button.

•	If the selected domain is not assigned to an attribute or column, ERwin deletes the selected domain without prompting you to confirm the delete action.

•	If the domain you want to delete is assigned to an attribute or column, click OK to delete the domain. When you delete a domain, all attribute or column properties set by that domain are reset to the parent domain setting.

5.	Click OK.


To specify a domain parent in the logical model

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Logical in the Edit Mode list.

3.	Select the domain you want to modify in the Domain list.

4.	Click the General tab.

5.	Click on the name of the domain that you want to assign as the parent in the Domain Parent list.

6.	Click OK.


To specify a domain definition in the logical model

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Logical in the Edit Mode list.

3.	Select the domain you want to modify in the Domain list.

4.	Click the Definition tab.

5.	Type a definition for the domain in the Definition text box.

6.	Click OK.


To specify a domain note in the logical model

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Logical in the Edit Mode list.

3.	Select the domain you want to modify in the Domain list.

4.	Click the Note tab.

5.	Type a note for the domain in the Note text box.

6.	Click OK.


To specify attribute domain UDP values

1.	Define a logical domain property, or an attribute property. More>>

2.	Select Domain Dictionary from the Edit menu.

3.	Select Logical in the Edit Mode list.

4.	Click on the UDP tab.

5.	Click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

6.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

7.	Click OK.


To create a physical domain

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Click New.

4.	Select a parent domain in the Domain Parent list (String, Number, Blob, Datetime, or a user-defined domain name).

5.	Type a domain in the Logical Name text box.

6.	Type a domain name in the Physical text box.

7.	Click OK.

8.	Choose one or more of the following options:

•	To assign a different parent domain, click the General tab then select a different parent domain name in the Domain Parent list.

•	To assign a different datatype or null option to the domain, click the <Database> tab.

•	To assign a validation rule to the domain, select a validation name in the Valid list in the <Database> tab.

•	To assign a default to the domain, select a default name in the Default list in the <Database> tab.

9.	Click OK.


To modify a physical domain name

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Select the domain you want to rename in the Domain list.

4.	Click the Rename button.

5.	Edit the name in the Physical text box.

6.	Click OK to close the Rename Domain dialog.

7.	Click OK.

Note:	You cannot rename the five standard ERwin domains (<default>, Blob, Datetime, Number, and String).


To delete a physical domain

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Select the domain you want to delete in the Domain list.

4.	Click the Delete button.

•	If the domain you select is not assigned to a column, ERwin immediately deletes the selected domain without asking you to confirm the delete action.

•	If the domain you want to delete is assigned to a column, click OK to delete the domain. When you delete a domain, all properties inherited by associated domains are reset to the parent domain setting.

5.	Click OK.

Note:	You cannot delete the five standard ERwin domains (<default>, Blob, Datetime Number, and String).


To specify a parent domain in the physical model

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Select the domain you want to modify in the Domain list.

4.	Click the General tab.

5.	Select the parent domain in the Domain Parent list. To show the inheritance, ERwin places the child domain name indented under the parent domain name in the Domain list.

6.	Click OK.


To create a domain that appears in the physical model only

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Select the domain you want to modify in the Domain list.

4.	Click the General tab.

5.	Select the Physical Only check box.

6.	Click OK.


To change physical domain properties

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Select the domain you want to modify in the Domain list.

4.	Click the Database tab.

5.	Choose from the following options:

•	To change the datatype, select the new datatype in the <database> Datatype list. If the selected datatype requires precision or scale parameters (for example, CHAR(), type the number(s) for precision and scale within the parentheses.

•	To change the null option, click an option button in the Null Option group box.

•	To assign a validation rule or default value, select an option in the Valid or the Default list.

6.	Click OK.


To specify a column definition using a physical domain

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Select the domain you want to modify in the Domain list.

4.	Click the Comment tab.

5.	Choose one of the following options:

•	If you want to override any existing column comment with the Comment Inherited by Column, delete the contents of the Comment Inherited by Column text box and type a definition that you want to attach to all columns that use the domain.

•	If you do not want to override existing column comments, delete the contents of the Comment Inherited by Column text box and type %AttDef in the text box.

6.	Click OK.


To specify a domain comment (physical)

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Select the domain you want to modify in the Domain list.

4.	Click the Comment tab.

5.	Type a definition for the domain in the Domain Comment text box.

6.	Click OK.


To specify column domain UDP values

1.	Define a Domain user-defined property or a Column user-defined property. More>>

2.	Choose Domain Dictionary on the Edit menu.

3.	Select Physical in the Edit Mode list.

4.	Click the UDP tab.

5.	In the Domain User-defined Properties grid, click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

6.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

7.	Click OK.


To specify column UDP values using a domain

1.	Define a Domain user-defined property or a Column user-defined property. More>>

2.	Choose Domain Dictionary on the Edit menu.

3.	Select Physical in the Edit Mode list.

4.	Click on the UDP tab.

5.	In the User-defined Property Inherited by Column grid, click in the Value box of the property that you want to specify.

•	When you point to the UDP Name, the UDP description displays in a ToolTip.

6.	Assign the UDP value in the Value box according to the datatype (List, Integer, Real Number, Text, Command, or Date).

7.	Click OK.


To specify a data warehouse source for a domain

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Domain Dictionary on the Edit menu.

3.	Select Physical in the Edit Mode list.

4.	Click on the Data Source tab.

5.	Click the [image] (Data Sources) button to open the Data Warehouse Source Selector dialog.

6.	Select one or more source columns from the Available Sources list by double-clicking on the source column.

7.	Click OK to close the Data Warehouse Source Selector dialog and to attach all source columns in the Selected Data Sources list to the selected column.

8.	Type a description of the data warehouse source in the Transform Comment text box.

9.	Click OK.


To remove a data warehouse source from a domain

1.	Select DM (Dimensional Modeling) notation for your physical model. More>

2.	Choose Domain Dictionary on the Edit menu.

3.	Select Physical in the Edit Mode list.

4.	Click on the Data Source tab.

5.	Click the [image] (Data Sources) button to open the Data Warehouse Source Selector dialog.

6.	Remove one or more source columns from the Selected Data Sources list by double-clicking on the source columns.

7.	Click OK to close the Data Warehouse Source Selector dialog and to attach only the source columns in the Selected Data Sources list to the selected column.

8.	Type a description of the data warehouse source in the Transform Comment text box.

9.	Click OK.


Implementing User Datatype Support Using Domains

A user-defined datatype is a named alias of an existing datatype in the database. Just like a domain, a user-defined datatype specifies datatype and other column properties for a column in your database. For example, you could create a MONEY datatype in DB2/2 to quickly define the characteristics of all columns that contain information in United States dollars. The MONEY datatype could be defined as DECIMAL(10,2) with a comment “Value in United States Dollars”.

Using the Domain Dictionary Editor, you can define user-defined datatypes, such as MONEY, for the target servers that support them. Support is provided for:

•	DB2/2 Distinct Types

•	Rdb Domains

•	InterBase Domains

•	SQL Anywhere User Datatypes

Once you have created a user-defined datatype, you can assign it to columns in your model the same way that you assign an ERwin domain.

Related Topics

  Summary of User Datatype Schema Generation Options

  To create a user-defined datatype


To create a user-defined datatype

1.	Choose Domain Dictionary on the Edit menu.

2.	Select Physical in the Edit Mode list.

3.	Click New.

4.	Select a parent domain in the Domain Parent list (String, Number, Blob, Datetime, or a user-defined domain name).

5.	Type a domain name in the Logical Name text box.

6.	Type a domain name in the Physical Name text box.

7.	Click OK.

8.	Click the General tab.

9.	Choose one of the following options:

•	To create a DB2/2 Distinct Type, select the Distinct Type option.

•	To create a Rdb or InterBase Domain, select the DOMAIN option.

•	To create a SQL Server, SQL Anywhere, WATCOM, or Sybase User Datatype, select the User Datatype option.

10.	Click the <Database>, Comment, and Client tabs to specify the remaining properties for the user-defined datatype.

11.	Click OK.

Note:	User-defined datatypes are supported by the following target servers: DB2/2, Rdb, InterBase, SQL Server, SQL Anywhere, WATCOM, and Sybase.


DB2/2 Distinct Types

When you assign the DB2/2 target server to a model, the Domain Dictionary Editor contains an additional control so you can generate a domain as a DB2/2 Distinct type.

•	Distinct Type. Select this option to generate the selected domain as a DB2/2 Distinct Type. Clear the option if you want the selected domain to set column properties without being generated as a DB2/2 Distinct Type.

The <DB> Schema Generation Report Editor has two options that let you determine how user-defined datatypes are generated in DB2/2.

Each option supporting DB2/2 Distinct Types is explained below:

•	Distinct Type. Select this option in the Schema Option group box to include a CREATE DISTINCT TYPE statement for each user datatype that you defined in the Domain Dictionary Editor.

•	Use Distinct Type. Select this option in the Column Option group box to include the USE DISTINCT TYPE clause in the CREATE TABLE statement for columns that are based on Distinct Types.


Rdb and Interbase Domains

When you choose the Rdb or Interbase target server, the Domain Dictionary Editor contains an additional control so you can generate a domain as an Rdb or Interbase Domain.

•	Domain. Select this option in the General tab to generate the selected domain as an Rdb or Interbase Domain. Clear the option if you want the selected domain to set column properties without being generated as a Domain.

The <DB> Schema Generation Report Editor has two options that let you determine how user-defined datatypes are generated in Rdb and Interbase.

Each option supporting Rdb and Interbase Domains is explained below:

•	CREATE DOMAIN. Select this option in the Schema option category to include a CREATE DOMAIN statement for each user-datatype you defined in the Domain Dictionary Editor.

•	USE DOMAIN. Select this option in the Column option category to include the USE DOMAIN clause in the CREATE TABLE statement for columns that are based on Domains.


SQL Anywhere User Datatypes

When you assign the SQL Anywhere target server to a model, the Domain Dictionary Editor contains an additional control so you can generate a domain as a SQL Anywhere User Datatype.

•	User-Datatype. Select this option in the General tab to generate the selected domain as a SQL Anywhere User-Datatype. Clear the option if you want the selected domain to set column properties without being generated as a SQL Anywhere User-Datatype.

The <DB> Schema Generation Report Editor has two options that let you determine how user-defined datatypes are generated in SQL Anywhere.

Each option supporting SQL Anywhere User-Datatypes is explained below:

•	Distinct Type. Select this option in the Schema option category to include a CREATE DATATYPE statement for each user datatype you defined in the Domain Dictionary Editor.

•	Use User Datatype. Select this option in the Column option category to include the USE USER DATATYPE clause in the CREATE TABLE statement for columns that are based on User Datatypes.


Summary of User Datatype Schema Generation Options

Target Server	Column Option	Schema Option
DB2/2	Use Distinct Type	DISTINCT TYPE
Rdb	Use DOMAIN	CREATE DOMAIN
InterBase	Use DOMAIN	CREATE DOMAIN
SQL Anywhere	Use User Datatype	CREATE DATATYPE